opentelemetry
Installation
SKILL.md
OpenTelemetry
Overview
OpenTelemetry (OTel) is the unified observability standard for instrumenting applications with traces, metrics, and logs. It supports auto-instrumentation across Node.js, Python, Java, and Go, and exports telemetry to backends like Jaeger, Grafana, Datadog, and Honeycomb through a flexible Collector pipeline.
Instructions
- When adding tracing, create spans with meaningful names, set span kinds (
CLIENT,SERVER,PRODUCER,CONSUMER), add business-relevant attributes, and use W3C Trace Context for propagation. - When adding metrics, choose the right instrument type: Counter for monotonic values, Histogram for distributions like latency, UpDownCounter for fluctuating values, and Gauge for point-in-time readings.
- When setting up auto-instrumentation, use the language-specific packages (
@opentelemetry/auto-instrumentations-node,opentelemetry-instrumentationfor Python, etc.) to capture HTTP, database, and messaging spans without code changes. - When configuring the OTel Collector, define pipelines with receivers (OTLP, Prometheus), processors (batch, memory_limiter, tail_sampling), and exporters (OTLP, Jaeger, Datadog) in the collector config.
- When deploying Collectors, choose sidecar mode for per-pod collection, agent mode for per-node, or gateway mode for centralized processing.
- When setting resource attributes, always include
service.name,service.version, anddeployment.environment, and use cloud/container resource detectors for infrastructure metadata. - When naming attributes, follow OTel semantic conventions (
http.request.method,db.system,messaging.system) instead of inventing custom names.
Examples
Example 1: Add distributed tracing to a Node.js microservice
Related skills