observability-guidelines — Claude Code skill: how to install
Guides coding agents on implementing OpenTelemetry tracing, metrics collection, and JSON logging across distributed microservices.
npx skills add Mindrally/skills --skill observability-guidelines -a claude-codeWhat observability-guidelines does
This skill enforces observability standards across distributed services using OpenTelemetry. It directs the AI agent to create spans with otel.Tracer, collect metrics through otel.Meter, and automatically instrument HTTP and gRPC endpoints with middleware. Telemetry targets include OpenTelemetry Collector, Jaeger, and Prometheus.
Tracing spans require context propagation across every service boundary. PII must stay out of logs. Records are formatted as JSON with trace and span IDs. Latency tracking covers p50, p90, p95, and p99 percentiles alongside throughput and error rates.
Production setups rely on head-based sampling for standard traffic and tail-based sampling to capture failures. Without configured telemetry collectors, exported spans and metrics will have nowhere to go.
What it helps with
- propagate trace context across HTTP and gRPC service boundaries
- collect request latency percentiles for p50, p90, p95, and p99
- format application logs as JSON correlated with trace IDs
- configure head-based and tail-based sampling for production traces
Example prompts for the agent
- Add OpenTelemetry middleware to trace incoming HTTP requests and internal calls
- Configure JSON structured logging that injects trace ID and span ID
- Set up latency percentile metrics from p50 to p99 using otel.Meter
How to install observability-guidelines
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a claude-code2Manually: put the files in place
~/.claude/skills/observability-guidelines/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/observability-guidelines/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a codex2Manually: put the files in place
.agents/skills/observability-guidelines/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a cursor2Manually: put the files in place
.cursor/skills/observability-guidelines/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills observability-guidelines2Manually: put the files in place
.github/skills/observability-guidelines/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path observability-guidelinesManually: put the files in place
.devin/skills/observability-guidelines/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill observability-guidelines -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about observability-guidelines
How do I install observability-guidelines in Claude Code?
Run npx skills add Mindrally/skills --skill observability-guidelines -a claude-code in your terminal. The rule file will be placed in ~/.claude/skills/observability-guidelines/SKILL.md.
What does the observability-guidelines skill do?
It provides development agents with guidelines for instrumenting services using OpenTelemetry, tracking latency percentiles, and generating structured JSON logs.
Which backend targets does the skill support for telemetry export?
The rules cover exporting telemetry to OpenTelemetry Collector, Jaeger, and Prometheus while using head-based and tail-based sampling strategies.
Source text
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