Agent-skills observability-edot-python-migrate
install
source · Clone the upstream repo
git clone https://github.com/elastic/agent-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/elastic/agent-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/observability/edot-python-migrate" ~/.claude/skills/elastic-agent-skills-observability-edot-python-migrate && rm -rf "$T"
manifest:
skills/observability/edot-python-migrate/SKILL.mdsource content
EDOT Python Migration
Read the migration guide before making changes:
Guidelines
- Remove ALL classic APM references:
from requirements,elastic-apm
/ElasticAPM(app)
from application code,elasticapm.contrib.*
blocks, and allapp.config['ELASTIC_APM']
env varsELASTIC_APM_* - Install
via pip (add toelastic-opentelemetry
or equivalent)requirements.txt - Run
during image build to install auto-instrumentation packages for detected librariesedot-bootstrap --action=install - Wrap the application entrypoint with
— e.g.opentelemetry-instrument
. Without this, no telemetry is collectedopentelemetry-instrument gunicorn app:app - Set exactly three required environment variables:
(replacesOTEL_SERVICE_NAME
)ELASTIC_APM_SERVICE_NAME
— must be the managed OTLP endpoint or EDOT Collector URL. Do NOT reuse the oldOTEL_EXPORTER_OTLP_ENDPOINT
value. Never use an APM Server URL (noELASTIC_APM_SERVER_URL
, noapm-server
, no:8200
)/intake/v2/events
—OTEL_EXPORTER_OTLP_HEADERS
or"Authorization=ApiKey <key>"
(replaces"Authorization=Bearer <token>"
)ELASTIC_APM_SECRET_TOKEN
- Do NOT set
,OTEL_TRACES_EXPORTER
, orOTEL_METRICS_EXPORTER
— the defaults are already correctOTEL_LOGS_EXPORTER - Never run both classic
and EDOT on the same applicationelastic-apm
Examples
See the EDOT Python migration guide for complete examples.