PluginBench
Skill
Review
Audit score 70

observability-edot-python-migrate

elastic/agent-skills

Migrate Python applications from classic Elastic APM agent to EDOT Python agent.

What is observability-edot-python-migrate?

This skill guides you through migrating a Python application from the elastic-apm package to elastic-opentelemetry (EDOT). Use it when you need to switch to OpenTelemetry-based instrumentation for better observability and future compatibility.

  • Remove classic APM dependencies and configuration from your Python application
  • Install and configure the elastic-opentelemetry package
  • Run edot-bootstrap to auto-instrument detected libraries
  • Wrap application entrypoint with opentelemetry-instrument for telemetry collection
  • Replace APM environment variables with OTEL equivalents

How to install observability-edot-python-migrate

npx skills add https://github.com/elastic/agent-skills --skill observability-edot-python-migrate
Prerequisites
  • Existing Python application using elastic-apm package
  • Access to managed OTLP endpoint or EDOT Collector URL
  • API key or bearer token for OTLP authentication
Claude Code
Cursor
Windsurf
Cline

How to use observability-edot-python-migrate

  1. 1.Read the official EDOT Python migration guide from Elastic documentation
  2. 2.Remove all elastic-apm references from requirements.txt and application code (ElasticAPM initialization, elasticapm.contrib imports, ELASTIC_APM config blocks)
  3. 3.Install elastic-opentelemetry package by adding it to requirements.txt
  4. 4.Run edot-bootstrap --action=install during your container image build to install auto-instrumentation packages
  5. 5.Wrap your application entrypoint with opentelemetry-instrument (e.g., opentelemetry-instrument gunicorn app:app)
  6. 6.Set three required environment variables: OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT (use managed OTLP endpoint, not APM Server URL), and OTEL_EXPORTER_OTLP_HEADERS with your API key or bearer token
  7. 7.Verify telemetry is being collected and remove any old ELASTIC_APM_* environment variables

Use cases

Good for
  • Upgrading an existing Flask or Django application from elastic-apm to EDOT
  • Migrating a containerized Python service to use OpenTelemetry instrumentation
  • Switching from APM Server to managed OTLP endpoint for observability
  • Consolidating multiple Python microservices to use EDOT for consistent telemetry
  • Preparing a Python application for future observability platform changes
Who it's for
  • Python developers maintaining applications with Elastic APM instrumentation
  • DevOps engineers managing Python service deployments
  • Teams migrating to OpenTelemetry-based observability
  • Elastic Cloud users upgrading their observability stack

observability-edot-python-migrate FAQ

Can I run both elastic-apm and EDOT on the same application?

No. Never run both classic elastic-apm and EDOT on the same application. You must fully remove the classic APM agent before deploying EDOT.

What OTEL_EXPORTER_OTLP_ENDPOINT should I use?

Use your managed OTLP endpoint or EDOT Collector URL. Do NOT reuse the old ELASTIC_APM_SERVER_URL value. Never use an APM Server URL (no apm-server, no :8200, no /intake/v2/events).

Do I need to set OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER, or OTEL_LOGS_EXPORTER?

No. Do not set these variables—the defaults are already correct for EDOT.

What replaces ELASTIC_APM_SERVICE_NAME?

Use OTEL_SERVICE_NAME instead. Set it to the same service name you used before.

What replaces ELASTIC_APM_SECRET_TOKEN?

Use OTEL_EXPORTER_OTLP_HEADERS with the value 'Authorization=ApiKey <key>' or 'Authorization=Bearer <token>' depending on your authentication method.

Full instructions (SKILL.md)

Source of truth, from elastic/agent-skills.


name: observability-edot-python-migrate description: > Migrate a Python application from the classic Elastic APM Python agent to the EDOT Python agent. Use when switching from elastic-apm to elastic-opentelemetry. metadata: author: elastic version: 0.1.0

EDOT Python Migration

Read the migration guide before making changes:

Guidelines

  1. Remove ALL classic APM references: elastic-apm from requirements, ElasticAPM(app) / elasticapm.contrib.* from application code, app.config['ELASTIC_APM'] blocks, and all ELASTIC_APM_* env vars
  2. Install elastic-opentelemetry via pip (add to requirements.txt or equivalent)
  3. Run edot-bootstrap --action=install during image build to install auto-instrumentation packages for detected libraries
  4. Wrap the application entrypoint with opentelemetry-instrument — e.g. opentelemetry-instrument gunicorn app:app. Without this, no telemetry is collected
  5. Set exactly three required environment variables:
    • OTEL_SERVICE_NAME (replaces ELASTIC_APM_SERVICE_NAME)
    • OTEL_EXPORTER_OTLP_ENDPOINT — must be the managed OTLP endpoint or EDOT Collector URL. Do NOT reuse the old ELASTIC_APM_SERVER_URL value. 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>" (replaces ELASTIC_APM_SECRET_TOKEN)
  6. Do NOT set OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER, or OTEL_LOGS_EXPORTER — the defaults are already correct
  7. Never run both classic elastic-apm and EDOT on the same application

Examples

See the EDOT Python migration guide for complete examples.