ancoleman/ai-design-components/implementing-observability
Claude Code and agent skill by ancoleman/ai-design-components
- community
Checking that the SKILL.md file is still in the repository.
Monitoring, logging, and tracing implementation using OpenTelemetry as the unified standard. Use when building production systems requiring visibility into performance, errors, and behavior. Covers OpenTelemetry (metrics, logs, traces), Prometheus, Grafana, Loki, Jaeger, Tempo, structured logging (structlog, tracing, slog, pino), and alerting.
Install
npx vskill@latest install ancoleman/ai-design-components/implementing-observabilitySKILL.md
Production Observability with OpenTelemetry
Purpose
Implement production-grade observability using OpenTelemetry as the 2025 industry standard. Covers the three pillars (metrics, logs, traces), LGTM stack deployment, and critical log-trace correlation patterns.
When to Use
Use when:
- Building production systems requiring visibility into performance and errors
- Debugging distributed systems with multiple services
- Setting up monitoring, logging, or tracing infrastructure
- Implementing structured logging with trace correlation
- Configuring alerting rules for production systems
Skip if:
- Building proof-of-concept without production deployment
- System has < 100 requests/day (console logging may suffice)
The OpenTelemetry Standard (2025)
OpenTelemetry is the CNCF graduated project unifying observability:
Context7 Reference: /websites/opentelemetry_io (Trust: High, Snippets: 5,888, Score: 85.9)
The Three Pillars of Observability
1. Metrics (What is happening?)
Track system health and performance over time.
Metric Types: Counters (always increase), Gauges (up/down), Histograms (distributions), Summaries (percentiles).
Brief Example (Python):
2. Logs (What happened?)
Record discrete events with context.
CRITICAL: Always inject trace_id/span_id for log-trace correlation.
Brief Example (Python + structlog):
See: references/structured-logging.md for complete configuration.
3. Traces (Where did time go?)
Track request flow across distributed services.
Key Concepts: Trace (end-to-end journey), Span (individual operation), Parent-Child (nested operations).
Brief Example (Python + FastAPI):
See: references/opentelemetry-setup.md for SDK installation by language.
The LGTM Stack (Self-Hosted Observability)
LGTM = Loki (Logs) + Grafana (Visualization) + Tempo (Traces) + Mimir (Metrics)
Quick Start: Run examples/lgtm-docker-compose/docker-compose.yml for a complete LGTM stack.
See: references/lgtm-stack.md for production deployment guide.
Critical Pattern: Log-Trace Correlation
The Problem: Logs and traces live in separate systems. You see an error log but can't find the related trace.
The Solution: Inject trace_id and span_id into every log record.
Python (structlog)
Rust (tracing)
See: references/trace-context.md for Go and TypeScript patterns.
Query in Grafana
Quick Setup Guide
1. Choose Your Stack
Decision Tree:
- Greenfield: OpenTelemetry SDK + LGTM Stack (self-hosted) or Grafana Cloud (managed)
- Existing Prometheus: Add Loki (logs) + Tempo (traces)
- Kubernetes: LGTM via Helm, Alloy DaemonSet
- Zero-ops: Managed SaaS (Grafana Cloud, Datadog, New Relic)
2. Install OpenTelemetry SDK
Bootstrap Script:
Manual (Python):
See: references/opentelemetry-setup.md for Rust, Go, TypeScript installation.
3. Deploy LGTM Stack
Docker Compose (development):
See: references/lgtm-stack.md for production Kubernetes deployment.
4. Configure Structured Logging
See: references/structured-logging.md for complete setup (Python, Rust, Go, TypeScript).
5. Set Up Alerting
See: references/alerting-rules.md for Prometheus and Loki alert patterns.
Auto-Instrumentation
OpenTelemetry auto-instruments popular frameworks:
Supported: FastAPI, Flask, Django, Express, Gin, Echo, Nest.js
See: references/opentelemetry-setup.md for framework-specific setup.
Common Patterns
Custom Spans
Error Tracking
See: references/trace-context.md for background job tracing and context propagation.
Validation and Testing
Integration with Other Skills
- Dashboards: Embed Grafana panels, query Prometheus metrics
- Feedback: Alert routing (Slack, PagerDuty), notification UI
- Data-Viz: Time-series charts, trace waterfall, latency heatmaps
See: examples/fastapi-otel/ for complete integration.
Progressive Disclosure
Setup Guides:
references/opentelemetry-setup.md- SDK installation (Python, Rust, Go, TypeScript)references/structured-logging.md- structlog, tracing, slog, pino configurationreferences/lgtm-stack.md- LGTM deployment (Docker, Kubernetes)references/trace-context.md- Log-trace correlation patternsreferences/alerting-rules.md- Prometheus and Loki alert templates
Examples:
examples/fastapi-otel/- FastAPI + OpenTelemetry + LGTMexamples/axum-tracing/- Rust Axum + tracing + LGTMexamples/lgtm-docker-compose/- Production-ready LGTM stack
Scripts:
scripts/setup_otel.py- Bootstrap OpenTelemetry SDKscripts/generate_dashboards.py- Generate Grafana dashboardsscripts/validate_metrics.py- Validate metric naming
Key Principles
- OpenTelemetry is THE standard - Use OTel SDK, not vendor-specific SDKs
- Auto-instrumentation first - Prefer auto over manual spans
- Always correlate logs and traces - Inject trace_id/span_id into every log
- Use structured logging - JSON format, consistent field names
- LGTM stack for self-hosting - Production-ready open-source stack
Common Pitfalls
Don't:
- Use vendor-specific SDKs (use OpenTelemetry)
- Log without trace_id/span_id context
- Manually instrument what auto-instrumentation covers
- Mix logging libraries (pick one: structlog, tracing, slog, pino)
Do:
- Start with auto-instrumentation
- Add manual spans only for business-critical operations
- Use semantic conventions for span attributes
- Export to OTLP (gRPC preferred over HTTP)
- Test locally with LGTM docker-compose before production
Success Metrics
- 100% of logs include trace_id when in request context
- Mean time to resolution (MTTR) decreases by >50%
- Developers use Grafana as first debugging tool
- 80%+ of telemetry from auto-instrumentation
- Alert noise < 5% false positives
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/implementing-observability/SKILL.md
Popularity
- Repository stars
- 326
- Repository forks
- 50
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 3 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ancoleman/ai-design-components/implementing-observability)