skills/otel-instrumentation/SKILL.md
Configures trace spans, defines custom metrics, sets up log exporters, and optimizes sampling strategies for OpenTelemetry instrumentation. Use when instrumenting applications with traces, metrics, or logs. Triggers on requests for observability, telemetry, tracing, metrics collection, logging integration, or OTel setup.
npx skillsauth add dash0hq/agent-skills otel-instrumentationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert guidance for implementing high-quality, cost-efficient OpenTelemetry telemetry.
| Use Case / Rule | Description | |-----------------|-------------| | telemetry | Entrypoint — signal types, correlation, and navigation | | resolve-values | Resolving configuration values from the codebase | | resources | Resource attributes — service identity and environment | | k8s | Kubernetes deployment — downward API, pod spec | | spans | Spans — naming, kind, status, and hygiene | | logs | Logs — structured logging, severity, trace correlation | | metrics | Metrics — instrument types, naming, units, cardinality | | sensitive-data | Sensitive data — PII prevention, sanitization, redaction | | capture-database-query-parameters | Prepared-statement parameter capture per language (Java, .NET, Python, Node.js, Go) | | validation | Telemetry validation — post-deployment verification checklist | | nodejs | Node.js instrumentation setup | | go | Go instrumentation setup | | python | Python instrumentation setup | | java | Java instrumentation setup | | scala | Scala instrumentation setup | | dotnet | .NET instrumentation setup | | ruby | Ruby instrumentation setup | | php | PHP instrumentation setup | | browser | Browser instrumentation setup | | nextjs | Next.js full-stack instrumentation (App Router) |
Follow these steps when instrumenting an application from scratch:
The snippet below shows a complete span with attributes and status for Node.js — see nodejs for full setup including SDK initialisation, exporter configuration, and auto-instrumentation:
const { trace, SpanStatusCode } = require('@opentelemetry/api');
const tracer = trace.getTracer('my-service', '1.0.0');
tracer.startActiveSpan('operation-name', async (span) => {
try {
span.setAttribute('user.id', userId);
span.setAttribute('order.id', orderId);
const result = await processOrder(orderId);
span.setAttribute('order.status', result.status);
span.setStatus({ code: SpanStatusCode.OK });
return result;
} catch (err) {
span.setStatus({ code: SpanStatusCode.ERROR, message: err.message });
span.recordException(err);
throw err;
} finally {
span.end();
}
});
Every telemetry item should serve one of three purposes:
If it doesn't serve one of these purposes, don't emit it.
Use the AlwaysOn sampler (the default) in every SDK.
Do not configure SDK-side samplers — they make irreversible decisions before the outcome of a request is known.
Defer all sampling to the Collector, where policies can be changed centrally without redeploying applications.
SDK (AlwaysOn) → Collector (sampling) → Backend (retention)
↓ ↓ ↓
All spans Head or tail Storage policies
exported sampling applied
development
OpenTelemetry Semantic Conventions expert. Use when selecting, applying, or reviewing telemetry attributes. Triggers on tasks involving attribute selection, semantic convention compliance, attribute migration, or custom attribute decisions. Covers the attribute registry, naming patterns, attribute placement, and versioning. For span names, span kinds, and span status codes, see the otel-instrumentation skill.
development
OpenTelemetry Transformation Language (OTTL) expert. Use when writing or debugging OTTL expressions for any OpenTelemetry Collector component that supports OTTL (processors, connectors, receivers, exporters). Triggers on tasks involving telemetry transformation, filtering, attribute manipulation, data redaction, sampling policies, routing, or Collector configuration. Covers syntax, contexts, functions, error handling, and performance.
devops
Expert guidance for configuring and deploying the OpenTelemetry Collector. Use when setting up a Collector pipeline, configuring receivers, exporters, or processors, deploying a Collector to Kubernetes or Docker, or forwarding telemetry to Dash0. Triggers on requests involving collector, pipeline, OTLP receiver, exporter, or Dash0 collector setup.
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".