observability-guidelines — скилл для Claude Code: как настроить
Скилл учит агента внедрять OpenTelemetry, трассировку и структурированные логи в распределённые сервисы. Пригодится при настройке мониторинга и метрик.
npx skills add Mindrally/skills --skill observability-guidelines -a claude-codeЧто делает observability-guidelines
Скилл задаёт правила наблюдаемости микросервисов на базе OpenTelemetry. Он направляет агента использовать otel.Tracer для создания спанов и otel.Meter для метрик, настраивать middleware для HTTP и gRPC, а также пробрасывать контекст сквозь цепочки вызовов. Экспорт данных ориентирован на OpenTelemetry Collector, Jaeger или Prometheus.
Инструкция требует разделять метрики ошибок на 4xx и 5xx, а также отслеживать задержку по перцентилям p50, p90, p95 и p99. Логи пишутся строго в JSON. Они обязаны содержать trace ID и span ID для корреляции, исключая пароли и персональные данные.
Для баланса расходов и глубины трейсинга предписано комбинировать head-based сэмплирование для типовых запросов и tail-based для фиксации ошибок. Без настроенного коллектора или приёмника телеметрии данные будет некуда отправлять.
Какие задачи решает
- связать логи и спаны сквозь цепочку микросервисов
- настроить сбор задержек по перцентилям p50, p90, p95 и p99
- добавить middleware для автоматической трассировки HTTP и gRPC
- внедрить JSON-логирование с trace ID и защитой от утечки паролей
Примеры запросов агенту
- Добавь сбор метрик p95 и p99 для HTTP-эндпоинтов через OpenTelemetry
- Настрой middleware трассировки gRPC с пробросом контекста
- Оформи структурированное логирование в JSON с полями trace ID и span ID
Как установить observability-guidelines
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a claude-code2Вручную: положить файлы
~/.claude/skills/observability-guidelines/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/observability-guidelines/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a codex2Вручную: положить файлы
.agents/skills/observability-guidelines/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a cursor2Вручную: положить файлы
.cursor/skills/observability-guidelines/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills observability-guidelines2Вручную: положить файлы
.github/skills/observability-guidelines/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path observability-guidelinesВручную: положить файлы
.devin/skills/observability-guidelines/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о observability-guidelines
Как установить observability-guidelines в Claude Code?
Выполните в терминале команду npx skills add Mindrally/skills --skill observability-guidelines -a claude-code. Файл правил запишется в ~/.claude/skills/observability-guidelines/SKILL.md.
Что делает скилл observability-guidelines?
Он передаёт агенту набор правил по внедрению OpenTelemetry, распределённой трассировки, экспорту метрик и структурированному логированию в распределённых архитектурах.
Куда экспортируются собранные метрики и трейсы?
Инструкции рассчитаны на экспорт данных в OpenTelemetry Collector, Jaeger или Prometheus с разделением сэмплирования на head-based и tail-based.
Исходный текст
SKILL.md · Apache-2.0
--- name: observability-guidelines description: Observability guidelines for distributed systems using OpenTelemetry, tracing, metrics, and structured logging metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Observability Guidelines Apply these observability principles to ensure comprehensive visibility into distributed systems and microservices. ## Core Observability Principles - Guide the development of idiomatic, maintainable, and high-performance code with built-in observability - Enforce modular design and separation of concerns through Clean Architecture - Promote test-driven development and robust observability from the start ## OpenTelemetry Integration - Use OpenTelemetry for distributed tracing, metrics, and structured logging - Start and propagate tracing spans across all service boundaries - Use otel.Tracer for creating spans and otel.Meter for collecting metrics - Export data to OpenTelemetry Collector, Jaeger, or Prometheus - Configure appropriate sampling rates for production environments ## Distributed Tracing - Trace all incoming requests and propagate context through internal calls - Use middleware to instrument HTTP and gRPC endpoints automatically - Include trace context in all downstream service calls - Create child spans for significant operations within a service - Add relevant attributes to spans for debugging and analysis ## Metrics Collection Monitor these key metrics across all services: - **Request latency**: Track p50, p90, p95, and p99 percentiles - **Throughput**: Measure requests per second by endpoint - **Error rate**: Track 4xx and 5xx responses separately - **Resource usage**: Monitor CPU, memory, disk, and network utilization - **Custom business metrics**: Track domain-specific KPIs ## Structured Logging - Include unique request IDs and trace context in all logs for correlation - Use structured logging formats (JSON) for machine parseability - Include relevant context: timestamp, service name, trace ID, span ID - Log at appropriate levels: DEBUG, INFO, WARN, ERROR - Avoid logging sensitive information (PII, credentials) ## Architecture Patterns - Apply Clean Architecture with handlers, services, repositories, and domain models - Use domain-driven design principles for clear boundaries - Prioritize interface-driven development with explicit dependency injection - Prefer composition over inheritance; favor small, purpose-specific interfaces ## Correlation and Context - Propagate context through the entire request lifecycle - Use correlation IDs for request tracking across services - Include service version and deployment information in telemetry - Tag traces with relevant business context for filtering - Enable trace-to-log and log-to-trace correlation ## Alerting and Dashboards - Create dashboards for service health and business metrics - Set up alerts based on SLOs and error budgets - Use anomaly detection for proactive issue identification - Document runbooks for common alert scenarios - Review and tune alerts regularly to reduce noise ## Instrumentation Best Practices - Instrument at service boundaries (entry/exit points) - Add custom spans for database operations and external calls - Include relevant attributes (user ID, request type, etc.) - Avoid over-instrumentation that creates noise - Use semantic conventions for consistent attribute naming ## Production Considerations - Configure appropriate sampling rates to balance visibility and cost - Use head-based sampling for consistent trace capture - Implement tail-based sampling for capturing errors - Set retention policies based on debugging needs - Monitor observability infrastructure health
© Mindrally · Apache-2.0 · Mindrally/skills