sb-dev/openquant / .agents/skills/otel-instrumentation
otel-instrumentation
VerifiedConfigures 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.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 4.8 KB |
| SKILL.md | skill md | 6.0 KB |
| rules/capture-database-query-parameters.md | markdown | 4.9 KB |
| rules/logs.md | markdown | 10.1 KB |
| rules/metrics.md | markdown | 22.7 KB |
| rules/platforms/k8s.md | markdown | 7.7 KB |
| rules/resolve-values.md | markdown | 11.3 KB |
| rules/resources.md | markdown | 10.9 KB |
| rules/sdks/browser.md | markdown | 5.2 KB |
| rules/sdks/dotnet.md | markdown | 20.6 KB |
| rules/sdks/go.md | markdown | 29.9 KB |
| rules/sdks/java.md | markdown | 17.2 KB |
| rules/sdks/nextjs.md | markdown | 16.2 KB |
| rules/sdks/nodejs.md | markdown | 24.7 KB |
| rules/sdks/php.md | markdown | 16.2 KB |
| rules/sdks/python.md | markdown | 18.4 KB |
| rules/sdks/ruby.md | markdown | 15.1 KB |
| rules/sdks/scala.md | markdown | 23.6 KB |
| rules/sensitive-data.md | markdown | 16.2 KB |
| rules/spans.md | markdown | 32.0 KB |
| rules/telemetry.md | markdown | 2.1 KB |
| rules/validation.md | markdown | 8.9 KB |
| rules/verify-dependencies.md | markdown | 6.6 KB |
README.md
View on GitHub# otel-instrumentation
Expert guidance for implementing high-quality, cost-efficient OpenTelemetry telemetry across multiple languages and platforms.
## Structure
<!-- eval:skip -->
```
otel-instrumentation/
├── SKILL.md # Skill manifest and entry point
├── README.md # This file
└── rules/
├── telemetry.md # Signal overview and correlation
├── resources.md # Resource attributes
├── metrics.md # Instrument types, naming, cardinality
├── logs.md # Structured logging, severity, trace correlation
└── sdks/
├── nodejs.md # Node.js instrumentation
├── go.md # Go instrumentation
├── python.md # Python instrumentation
├── java.md # Java instrumentation
├── dotnet.md # .NET instrumentation
├── ruby.md # Ruby instrumentation
├── php.md # PHP instrumentation
├── browser.md # Browser instrumentation
└── nextjs.md # Next.js full-stack instrumentation
```
## Getting Started
Install the skill:
```bash
npx skills add dash0/otel-instrumentation
```
The skill activates automatically when working on observability tasks.
## Rules
| Rule | Impact | Description |
|------|--------|-------------|
| [telemetry](./rules/telemetry.md) | CRITICAL | Signal overview and correlation |
| [resources](./rules/resources.md) | CRITICAL | Resource attributes - service identity, environment, Kubernetes |
| [metrics](./rules/metrics.md) | CRITICAL | Instrument types, naming, units, cardinality |
| [logs](./rules/logs.md) | CRITICAL | Structured logging, severity, trace correlation |
| [nodejs](./rules/sdks/nodejs.md) | HIGH | Node.js auto-instrumentation setup |
| [go](./rules/sdks/go.md) | HIGH | Go instrumentation setup |
| [python](./rules/sdks/python.md) | HIGH | Python auto-instrumentation setup |
| [java](./rules/sdks/java.md) | HIGH | Java auto-instrumentation setup |
| [dotnet](./rules/sdks/dotnet.md) | HIGH | .NET auto-instrumentation setup |
| [ruby](./rules/sdks/ruby.md) | HIGH | Ruby instrumentation setup |
| [php](./rules/sdks/php.md) | HIGH | PHP auto-instrumentation setup |
| [browser](./rules/sdks/browser.md) | HIGH | Browser instrumentation with Dash0 SDK |
| [nextjs](./rules/sdks/nextjs.md) | HIGH | Next.js full-stack instrumentation (App Router) |
## Rule File Structure
Each rule follows a consistent format:
<!-- eval:skip -->
```yaml
---
title: "Rule Title"
impact: CRITICAL | HIGH | MEDIUM | LOW
tags:
- telemetry
- spans
---
```
**Content sections:**
1. Core concepts and quick start
2. Implementation with code examples
3. Best practices (do's and don'ts)
4. Troubleshooting common issues
## Impact Levels
| Level | Meaning |
|-------|---------|
| CRITICAL | Affects data quality, costs, or system reliability |
| HIGH | Significant impact on observability effectiveness |
| MEDIUM | Improves telemetry quality or developer experience |
| LOW | Nice-to-have optimizations |
## Quick Start
**Get your credentials:**
- **OTLP Endpoint**: In Dash0: [Settings → Organization → Endpoints](https://app.dash0.com/settings/endpoints?s=eJwtyzEOgCAQRNG7TG1Cb29h5REMcVclIUDYsSLcXUxsZ95vcJgbxNObEjNET_9Eok9wY2FIlzlNUnJItM_GYAM2WK7cqmgdlbcDE0yjHlRZfr7KuDJj2W-yoPf-AmNVJ2I%3D)
- **Auth Token**: In Dash0: [Settings → Auth Tokens → Create Token](https://app.dash0.com/settings/auth-tokens)
**Node.js:**
```bash
npm install @opentelemetry/auto-instrumentations-node
export OTEL_SERVICE_NAME="my-service"
export OTEL_TRACES_EXPORTER="otlp" # Required! Defaults to "none"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://<OTLP_ENDPOINT>"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <AUTH_TOKEN>"
# Use --import for ESM projects, --require for CommonJS
export NODE_OPTIONS="--import @opentelemetry/auto-instrumentations-node/register"
node app.js
```
**Browser:**
```bash
npm install @dash0/sdk-web
```
```javascript
import { init } from "@dash0/sdk-web";
init({
serviceName: "my-frontend",
endpoint: { url: "https://<OTLP_ENDPOINT>", authToken: "<AUTH_TOKEN>" }
});
```
## Key Principles
- **Signal density over volume** - Every telemetry item should help detect, localize, or explain issues
- **Push reduction early** - SDK sampling → Collector filtering → Backend retention
- **SLO-aware policies** - Never sample data feeding your SLOs
## Resources
- [OpenTelemetry Docs](https://opentelemetry.io/docs/)
- [Dash0 Integration Hub](https://www.dash0.com/hub/integrations)
- [Dash0 Guides](https://www.dash0.com/guides?category=opentelemetry)
## Contributing
1. Follow the rule template in `rules/_template.md`
2. Use concrete code examples over abstract explanations
3. Include both "good" and "bad" patterns
4. Keep examples copy-pasteable
## License
Apache-2.0
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |