Skip to main content
skill CX Codex

otel-python — Claude Code skill: OpenTelemetry for Python

A skill that helps your agent set up and debug OpenTelemetry in Python services: SDK config, declarative YAML, zero-code instrumentation.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-python -a claude-code
Open on GitHub

What otel-python does

The skill gives the agent five self-contained references instead of one long document. Declarative setup covers YAML config through opentelemetry-configuration: load_config_file, configure_sdk, environment substitution, OTEL_CONFIG_FILE. The API reference lists import paths, tracer, meter and logger usage, propagation, and the LoggingHandler bridge that ties Python logs to traces. A third file walks through zero-code instrumentation with opentelemetry-distro, opentelemetry-bootstrap and opentelemetry-instrument, plus the contrib catalog and manual instrumentation.

Two more references handle tuning and breakage. Performance covers sampling, the batch span processor, periodic metric reader, views, asyncio context, exporters and graceful shutdown. The breaking-changes file is for auditing existing code against renamed or deprecated APIs and semantic convention shifts.

Version facts are not baked in. The agent is told to fetch PyPI for opentelemetry-sdk, opentelemetry-configuration, opentelemetry-distro, opentelemetry-exporter-otlp and contrib packages, and to pull the YAML schema from the otel-declarative-config skill. The bundled references reflect release 1.45.1 and contrib 0.66b1, so on a pinned older SDK expect answers that no longer match your code.

What it helps with

  • Wire up TracerProvider and MeterProvider in a Python service
  • Turn on auto-instrumentation for FastAPI, Flask or Django without editing app code
  • Move SDK configuration to declarative YAML
  • Connect Python logs to traces with LoggingHandler
  • Audit code for renamed APIs after an SDK upgrade

Example prompts for the agent

  • Set up OpenTelemetry in my FastAPI service using declarative YAML
  • Why doesn't opentelemetry-instrument pick up my Flask app?
  • Check this code for deprecated OpenTelemetry APIs after the SDK bump

How to install otel-python

1Skills CLI (Vercel)

npx skills add ollygarden/opentelemetry-agent-skills --skill otel-python -a claude-code

2Manually: put the files in place

~/.claude/skills/otel-python/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/otel-python/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about otel-python

How do I install otel-python in Claude Code?

Run npx skills add ollygarden/opentelemetry-agent-skills --skill otel-python -a claude-code, then confirm the file landed at ~/.claude/skills/otel-python/SKILL.md.

What does the otel-python skill do?

It hands your agent references on OpenTelemetry in Python: SDK setup, declarative config, auto-instrumentation, the manual API, performance tuning and breaking changes.

Does it work alongside other skills?

Yes. It defers to otel-declarative-config for the YAML schema, otel-sdk-versions for picking SDK versions across languages, and otel-semantic-conventions for semconv lookups.

Source text

SKILL.md · Apache-2.0
---
name: otel-python
description: OpenTelemetry in Python — SDK setup, declarative config, zero-code instrumentation (opentelemetry-instrument, opentelemetry-distro), contrib auto-instrumentation, manual API, performance tuning, breaking changes. Use when configuring or troubleshooting OpenTelemetry in a Python service. Triggers on "setup otel in python", "python telemetry", "python tracing", "opentelemetry-instrument", "opentelemetry-distro", "TracerProvider python", "MeterProvider python", "FastAPI/Flask/Django otel", "python logging bridge".
---

# OpenTelemetry in Python

Entry point for OpenTelemetry mechanics in Python services. Load a reference below based on
the task; each reference is self-contained.

## References

| File | Use when |
|---|---|
| [`references/declarative-setup.md`](references/declarative-setup.md) | Configuring the SDK via declarative YAML (`opentelemetry-configuration` / `opentelemetry.configuration`): `load_config_file`, `configure_sdk`, `file_format`, env substitution, `OTEL_CONFIG_FILE` and programmatic activation. |
| [`references/api.md`](references/api.md) | Import paths, global API access, tracer/meter/logger usage, attributes, propagation, the Python logging bridge (`LoggingHandler`). |
| [`references/instrumentation-libraries.md`](references/instrumentation-libraries.md) | Zero-code (`opentelemetry-distro`, `opentelemetry-bootstrap`, `opentelemetry-instrument`), the contrib catalog, and manual instrumentation following semconv. |
| [`references/performance.md`](references/performance.md) | Tuning sampling, batch span processor, periodic metric reader, views, asyncio context, exporters, graceful shutdown. |
| [`references/breaking-changes.md`](references/breaking-changes.md) | Auditing existing code for deprecated/renamed APIs and semconv changes across recent SDK/contrib releases. |

## Sources of Truth

For YAML schema details, fetch the upstream sources listed in the `otel-declarative-config` skill.
For Python-specific facts:

| Fact | Fetch |
|---|---|
| Latest `opentelemetry-sdk` / `opentelemetry-api` | `WebFetch https://pypi.org/pypi/opentelemetry-sdk/json` (`.info.version`) |
| Latest `opentelemetry-configuration` | `WebFetch https://pypi.org/pypi/opentelemetry-configuration/json` |
| Latest `opentelemetry-distro` | `WebFetch https://pypi.org/pypi/opentelemetry-distro/json` |
| Latest `opentelemetry-instrumentation-<pkg>` (contrib) | `WebFetch https://pypi.org/pypi/opentelemetry-instrumentation-<pkg>/json` |
| Latest OTLP exporter | `WebFetch https://pypi.org/pypi/opentelemetry-exporter-otlp/json` |
| Declarative config support (released 1.45.1 overview; verified 2026-10-19) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-python/v1.45.1/opentelemetry-configuration/README.rst` |
| Declarative config vendored schema (released 1.45.1) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-python/v1.45.1/opentelemetry-configuration/src/opentelemetry/configuration/schema.json` |
| SDK CHANGELOG through 1.45.1 | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-python/v1.45.1/CHANGELOG.md` |
| Contrib CHANGELOG through 0.66b1 | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-python-contrib/v0.66b1/CHANGELOG.md` |
| Python getting-started docs | `WebFetch https://opentelemetry.io/docs/languages/python/getting-started/` |

## Cross-References

- Schema-level facts: `otel-declarative-config` skill (language-agnostic YAML schema sources).
- SDK version selection across languages: `otel-sdk-versions` skill.
- Semantic conventions lookup: `otel-semantic-conventions` skill.

© ollygarden · Apache-2.0 · ollygarden/opentelemetry-agent-skills

Similar skills

All skills for Backend and APIs →

From the same set7

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor