otel-instrumentation
This skill guides agents through configuring OpenTelemetry instrumentation across traces, metrics, and logs.
Identity proven by GitHub's verified organisation badge (dash0hq)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- Apache-2.0 (permissive)
- Pin
- 51a0324pinned Oct 9, 2026
- Context cost
- about 1,300 tokenswhen the skill loads
- GitHub stars
- 96on dash0hq/agent-skills
- Scripts
- None found
What it does
“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.”
Generated summary from the skill's own text
This skill guides agents through configuring OpenTelemetry instrumentation across traces, metrics, and logs. It provides rules and language-specific setup instructions for Node.js, Python, Go, Java, .NET, Ruby, PHP, Scala, Browser, and Next.js, along with best practices for resource attributes, span hygiene, sensitive data handling, and validation.
When to use it
- Adding traces, metrics, or logs to an application using OpenTelemetry
- Setting up instrumentation for a specific language or framework
- Implementing cost-efficient telemetry with proper sampling strategies
- Ensuring telemetry correctness before deployment
When not to
- Configuring OpenTelemetry Collector pipeline or exporters
- Analyzing or debugging existing telemetry data
- Setting up non-OpenTelemetry observability solutions
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add dash0hq/agent-skills --skill otel-instrumentationInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install dash0hq/agent-skills otel-instrumentation@51a0324eb0c991f66fe9c5987799f4246ec1db44Installs the commit we checked (51a0324).
Copy by hand
Download the folder at 51a0324 and put it in .claude/skills/otel-instrumentation for Claude Code and in .agents/skills/otel-instrumentation for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install dash0@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "otel-instrumentation" by Dash0. Source, pinned to commit 51a0324eb0c991f66fe9c5987799f4246ec1db44: https://github.com/dash0hq/agent-skills/tree/51a0324eb0c991f66fe9c5987799f4246ec1db44/skills/otel-instrumentation 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/otel-instrumentation/ for Claude Code and .agents/skills/otel-instrumentation/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/dash0/otel-instrumentation
SKILL.md at the pin
---
name: 'otel-instrumentation'
description: 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.
license: Apache-2.0
metadata:
author: dash0
version: '2.0.0'
workflow_type: 'advisory'
supports-traces: "true"
supports-metrics: "true"
supports-logs: "true"
---
# OpenTelemetry Instrumentation Guide
Expert guidance for implementing high-quality, cost-efficient OpenTelemetry telemetry.
## Rules & Quick Reference
| Use Case / Rule | Description |
|-----------------|-------------|
| [telemetry](./rules/telemetry.md) | **Entrypoint** — signal types, correlation, and navigation |
| [resolve-values](./rules/resolve-values.md) | Resolving configuration values from the codebase |
| [verify-dependencies](./rules/verify-dependencies.md) | Verifying instrumentation packages and versions exist before adding them |
| [resources](./rules/resources.md) | Resource attributes — service identity and environment |
| [k8s](./rules/platforms/k8s.md) | Kubernetes deployment — downward API, pod spec |
| [spans](./rules/spans.md) | Spans — naming, kind, status, and hygiene |
| [logs](./rules/logs.md) | Logs — structured logging, severity, trace correlation |
| [metrics](./rules/metrics.md) | Metrics — instrument types, naming, units, cardinality |
| [sensitive-data](./rules/sensitive-data.md) | Sensitive data — PII prevention, sanitization, redaction |
| [capture-database-query-parameters](./rules/capture-database-query-parameters.md) | Prepared-statement parameter capture per language (Java, .NET, Python, Node.js, Go) |
| [validation](./rules/validation.md) | Telemetry validation — post-deployment verification checklist |
| [nodejs](./rules/sdks/nodejs.md) | Node.js instrumentation setup |
| [go](./rules/sdks/go.md) | Go instrumentation setup |
| [python](./rules/sdks/python.md) | Python instrumentation setup |
| [java](./rules/sdks/java.md) | Java instrumentation setup |
| [scala](./rules/sdks/scala.md) | Scala instrumentation setup |
| [dotnet](./rules/sdks/dotnet.md) | .NET instrumentation setup |
| [ruby](./rules/sdks/ruby.md) | Ruby instrumentation setup |
| [php](./rules/sdks/php.md) | PHP instrumentation setup |
| [browser](./rules/sdks/browser.md) | Browser instrumentation setup |
| [nextjs](./rules/sdks/nextjs.md) | Next.js full-stack instrumentation (App Router) |
## Official documentation
- [OpenTelemetry Documentation](https://opentelemetry.io/docs/)
- [Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/)
- [Dash0 Integration Hub](https://www.dash0.com/hub/integrations)
## Getting started
Follow these steps when instrumenting an application from scratch:
1. **Pick your SDK rule** — choose the language-specific rule from the table above (e.g., [nodejs](./rules/sdks/nodejs.md), [python](./rules/sdks/python.md)).
2. **Set up resource attributes** — define service identity and environment per [resources](./rules/resources.md).
3. **Add spans, metrics, and logs** — instrument your code following [spans](./rules/spans.md), [metrics](./rules/metrics.md), and [logs](./rules/logs.md).
4. **Guard sensitive data** — scrub PII before export per [sensitive-data](./rules/sensitive-data.md).
5. **Validate** — confirm telemetry reaches the backend using the checklist in [validation](./rules/validation.md).
The snippet below shows a complete span with attributes and status for Node.js — see [nodejs](./rules/sdks/nodejs.md) for full setup including SDK initialisation, exporter configuration, and auto-instrumentation:
```js
import { trace, SpanStatusCode } from '@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) {
// Record the exception as a structured log record, not span.recordException — see rules/spans.md
span.setStatus({ code: SpanStatusCode.ERROR, message: `${err.name}: ${err.message}` });
const spanContext = span.spanContext();
logger.error('operation-name.failed', {
'trace_id': spanContext.traceId,
'span_id': spanContext.spanId,
'exception.type': err.name,
'exception.message': err.message,
'exception.stacktrace': err.stack,
});
throw err;
} finally {
span.end();
}
});
```
## Key principles
### Signal density over volume
Every telemetry item should serve one of three purposes:
- **Detect** - Help identify that something is wrong
- **Localize** - Help pinpoint where the problem is
- **Explain** - Help understand why it happened
If it doesn't serve one of these purposes, don't emit it.
### Sample in the pipeline, not the SDK
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](../otel-collector/rules/sampling.md), where policies can be changed centrally without redeploying applications.
<!-- eval:skip -->
```
SDK (AlwaysOn) → Collector (sampling) → Backend (retention)
↓ ↓ ↓
All spans Head or tail Storage policies
exported sampling applied
```
From dash0hq/agent-skills at 51a0324, shown as plain text under its license: Apache-2.0 (permissive). The license text is in skills/otel-instrumentation/SKILL.md.
View SKILL.md on GitHub at 51a0324Files
- SKILL.md5.7 KB · e79c66b5f75c
- README.md4.9 KB · 82f9e47627af
- rules/
- capture-database-query-parameters.md5.1 KB · f1c56b8e7e7c
- logs.md10 KB · e0012694b54d
- metrics.md23 KB · 4c1bfc871c3f
- platforms/
- k8s.md7.9 KB · 3f5921df6de0
- resolve-values.md12 KB · 83992f5bd2c5
- resources.md11 KB · b3d64c524863
- sdks/
- browser.md5.2 KB · d8554f6da8d6
- dotnet.md21 KB · 9f99faa2a9a1
- go.md30 KB · 5f1475233613
- java.md17 KB · 0c8e24e9286f
- nextjs.md16 KB · ac76ff3730b4
- nodejs.md25 KB · 3b6d0b159b81
- php.md16 KB · 6616a21e96a9
- python.md19 KB · 313f6546faa5
- ruby.md15 KB · 8115461eb54a
- scala.md24 KB · 303a4dbe53f8
- sensitive-data.md17 KB · 694d27127409
- spans.md27 KB · dc62254d65c2
- telemetry.md2.2 KB · e5cd46ee7400
- validation.md7.3 KB · 0058050e55b1
- verify-dependencies.md6.8 KB · 80d98a66508f
23 files, 329 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 51a0324More from Dash0
otel-collector
This skill provides expert guidance for configuring and deploying the OpenTelemetry Collector to receive, process, and export telemetry data.
Claude Code, Codex, Cursor +4 · about 1.7K tokens · pinned 6 days ago
otel-ottl
This skill provides expertise in OpenTelemetry Transformation Language (OTTL), helping agents write and debug OTTL expressions for OpenTelemetry Collector…
Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 6 days ago
otel-semantic-conventions
This skill helps select and apply OpenTelemetry semantic convention attributes correctly.
Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago
copilot-local-dev
This skill installs and runs the Dash0 GitHub Copilot CLI plugin locally for development and testing without requiring a GitHub push or release.
Contains scripts
Claude Code, Codex, Cursor +3 · about 940 tokens · pinned 6 days ago
dash0-configure
Writes a Dash0 configuration file that connects Claude Code to Dash0 telemetry by storing OTLP credentials and team settings.
Claude Code · about 2.6K tokens · pinned 6 days ago
dash0-configure
Configures the Dash0 telemetry extension for the GitHub Copilot app by writing the OTLP URL, authentication token, team name, and dataset to a config file at…
Claude Code, Codex, Cursor +4 · about 1.5K tokens · pinned 6 days ago
Related in Observability
clickstack-otel-collector
Sets up an OpenTelemetry collector for ClickHouse Cloud's Managed ClickStack, either by deploying a new local collector via Docker or configuring an existing…
by ClickHouseOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 9.7K tokens · pinned 6 days ago
dash0-configure
This skill configures Dash0 telemetry integration for GitHub Copilot CLI by writing credentials and options to a config file, then installing a launch shell…
by Dash0Official publisher
Claude Code, Codex, Cursor +4 · about 3.4K tokens · pinned 6 days ago
debugging-executions
Debug workflow execution failures by inspecting failed nodes, re-running executions, and comparing expected versus actual values.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.5K tokens · pinned 6 days ago
instance-awareness
This skill teaches the agent to resolve ambiguous requests by reading the instance's activity log and workflow history instead of asking the user to clarify.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 1.3K tokens · pinned 6 days ago
creating-replay-vision-scanners
Guides agents through creating Replay Vision scanners, LLM probes that watch session recordings on a schedule and log findings as observations.
by PostHogOfficial publisher
Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 6 days ago
exploring-replay-vision-observations
This skill guides agents through reading observations from Replay Vision scanners, understanding their findings across session recordings, and taking action…
by PostHogOfficial publisher
Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 6 days ago