otel-instrumentation

Configure OpenTelemetry SDKs and custom instrumentation to send traces to Honeycomb.

Updated Jun 4, 2026
One-click install
npx skills add https://github.com/krzko/pokemon-api --skill otel-instrumentation-krzko
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: otel-instrumentation
Source: https://github.com/krzko/pokemon-api/tree/main/.claude/skills/otel-instrumentation
Command: npx skills add https://github.com/krzko/pokemon-api --skill otel-instrumentation-krzko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up OpenTelemetry correctly is error-prone: SDK setup differs per language, async frameworks break naive instrumentation, and poorly designed spans produce traces that are either too sparse to debug or too noisy to query. This Skill provides concrete guidance for instrumenting applications with OpenTelemetry and shipping telemetry to Honeycomb. ## Core Features & Use Cases - Multi-language SDK setup: Step-by-step OTLP configuration and dependencies for Go, Python, Node.js, Java, Ruby, .NET, and Rust, including a dedicated deep-dive for Python ASGI apps and AWS Lambda. - Custom instrumentation patterns: Add attributes to existing spans, create custom spans, record timing attributes, tag errors with greppable exception slugs, and roll up async request statistics. - Sampling and architecture guidance: Head vs tail sampling tradeoffs, OTel Collector configuration, and trace design patterns for streaming, async jobs, ETL, and serverless workloads. - Use Case: A developer adds tracing to a FastAPI service: the Skill provides the programmatic SDK setup, the critical .sync_engine fix for async SQLAlchemy, middleware for per-request user attributes, and a local Collector workflow to verify spans before sending to Honeycomb. ## Quick Start Ask the assistant to instrument your application with OpenTelemetry and send traces to Honeycomb, specifying your language and framework.

Frequently Asked Questions about otel-instrumentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up OpenTelemetry to send traces to Honeycomb?▼

Set three environment variables: OTEL_EXPORTER_OTLP_ENDPOINT (https://api.honeycomb.io), OTEL_EXPORTER_OTLP_HEADERS with your API key, and OTEL_SERVICE_NAME. Then install the OTel SDK and exporter for your language and add auto-instrumentation for your frameworks.

How do I instrument a FastAPI application with OpenTelemetry?▼

Use programmatic SDK setup rather than the opentelemetry-instrument CLI, which does not integrate cleanly with ASGI lifespans. Create a telemetry module with a TracerProvider and BatchSpanProcessor, then call FastAPIInstrumentor.instrument_app(app) after all routes are mounted.

Should I use head sampling or tail sampling for traces?▼

Head sampling is simpler but can miss rare errors; a 0.1% error at 1% sampling appears once per 100,000 requests. Tail sampling via Honeycomb Refinery or the Collector keeps errors and slow traces while sampling routine traffic, at the cost of extra infrastructure.

Why does SQLAlchemyInstrumentor fail with async engines?▼

SQLAlchemyInstrumentor does not support async engines directly and raises NotImplementedError at startup. Pass the underlying sync engine instead: SQLAlchemyInstrumentor().instrument(engine=async_engine.sync_engine).

Why are my Lambda spans missing in Honeycomb?▼

Lambda freezes the process when the handler returns, so BatchSpanProcessor's background flush never fires and queued spans are dropped. Call provider.forceFlush() in a finally block before the handler returns, or use the AWS managed OTel layer which exports after the response.

When should I create a custom span versus adding attributes?▼

Create a span only if the operation meaningfully impacts latency or failures and grouping it by name produces useful trends. For sub-operation timings, prefer attributes on the parent span, which are easier to query and work directly with BubbleUp.