
Observability Edot Python Instrument
Add Elastic OpenTelemetry traces, metrics, and logs to a Python service that has no APM agent yet.
Overview
observability-edot-python-instrument is an agent skill for the Operate phase that instruments Python services with Elastic OpenTelemetry (EDOT) for automatic tracing, metrics, and logs via OTLP.
Install
npx skills add https://github.com/elastic/agent-skills --skill observability-edot-python-instrumentWhat is this skill?
- Install `elastic-opentelemetry` and run `edot-bootstrap --action=install` at image build for detected libraries
- Wrap the entrypoint with `opentelemetry-instrument` (e.g. gunicorn or `python app.py`)—without it no telemetry is collec
- Three required env vars: `OTEL_SERVICE_NAME`, OTLP endpoint (managed OTLP or EDOT Collector—never APM Server `:8200`)
- `OTEL_EXPORTER_OTLP_HEADERS` with `Authorization=ApiKey <key>` for Elastic export
- Points to official EDOT Python setup, configuration, and OpenTelemetry zero-code Python docs before changing the repo
- Exactly 3 required environment variables: OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS
Adoption & trust: 949 installs on skills.sh; 502 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Python service runs in production but you have no APM agent and no standardized traces, metrics, or logs flowing into Elastic.
Who is it for?
Solo builders shipping FastAPI, Flask, or Gunicorn Python APIs who want Elastic-backed observability with minimal code changes.
Skip if: Teams that already run a different APM agent end-to-end, or apps that must only use legacy APM Server `:8200` intake (this skill forbids that pattern).
When should I use this skill?
Adding observability to a Python service that has no existing APM agent.
What do I get? / Deliverables
After following the skill, the app runs under OpenTelemetry auto-instrumentation with correct OTLP export settings so Elastic receives service telemetry without an APM Server intake URL.
- Updated requirements with elastic-opentelemetry
- Build step running edot-bootstrap --action=install
- Entrypoint wrapped with opentelemetry-instrument and documented OTLP env vars
Recommended Skills
Journey fit
Observability wiring is a production concern: you instrument after you have something to run, and keep signals flowing while you operate the service. EDOT Python auto-instrumentation and OTLP export map directly to monitoring setup—not launch marketing or greenfield coding.
How it compares
Use for Elastic OTLP/EDOT bootstrap and env wiring—not for writing custom OpenTelemetry span code from scratch in application logic.
Common Questions / FAQ
Who is observability-edot-python-instrument for?
Indie and solo developers operating Python backends on Elastic who need traces, metrics, and logs without adopting the old APM Server URL pattern.
When should I use observability-edot-python-instrument?
During Operate when you turn on monitoring for a Python service, after deploy when incidents lack traces, or when validating staging export to Elastic’s managed OTLP endpoint.
Is observability-edot-python-instrument safe to install?
Review the Security Audits panel on this Prism page before piping `OTEL_EXPORTER_OTLP_HEADERS` and API keys into CI or images; the skill requires network export and dependency installs.
SKILL.md
READMESKILL.md - Observability Edot Python Instrument
# EDOT Python Instrumentation Read the setup guide before making changes: - [EDOT Python setup](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/python/setup) - [EDOT Python configuration](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/python/configuration) - [OpenTelemetry Python auto-instrumentation](https://opentelemetry.io/docs/zero-code/python/) ## Guidelines 1. Install `elastic-opentelemetry` via pip (add to `requirements.txt` or equivalent) 1. Run `edot-bootstrap --action=install` during image build to install auto-instrumentation packages for detected libraries 1. Wrap the application entrypoint with `opentelemetry-instrument` — e.g. `opentelemetry-instrument gunicorn app:app` or `opentelemetry-instrument python app.py`. Without this, no telemetry is collected 1. Set exactly three required environment variables: - `OTEL_SERVICE_NAME` - `OTEL_EXPORTER_OTLP_ENDPOINT` — must be the **managed OTLP endpoint** or **EDOT Collector** URL. Never use an APM Server URL (no `apm-server`, no `:8200`, no `/intake/v2/events`) - `OTEL_EXPORTER_OTLP_HEADERS` — `"Authorization=ApiKey <key>"` or `"Authorization=Bearer <token>"` 1. Do NOT set `OTEL_TRACES_EXPORTER`, `OTEL_METRICS_EXPORTER`, or `OTEL_LOGS_EXPORTER` — the defaults are already correct 1. Do NOT add code-level SDK setup (no `TracerProvider`, no `configure_azure_monitor`, etc.) — `opentelemetry-instrument` handles everything 1. Never run both classic `elastic-apm` and EDOT on the same application ## Examples See the [EDOT Python setup guide](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/python/setup) for complete examples.