{"id":23660,"library":"elastic-opentelemetry","title":"Elastic Distribution of OpenTelemetry Python","description":"The Elastic Distribution of OpenTelemetry Python (EDOT Python) provides a pre-configured OpenTelemetry Python SDK and auto-instrumentation packages that are compatible with the Elastic Observability solution. It simplifies the process of instrumenting Python applications and sending telemetry data to Elastic. Currently at v1.12.0, active development with frequent minor releases.","status":"active","version":"1.12.0","language":"python","source_language":"en","source_url":"https://github.com/elastic/elastic-otel-python","tags":["opentelemetry","elastic","observability","tracing","instrumentation"],"install":[{"cmd":"pip install elastic-opentelemetry","lang":"bash","label":"Install EDOT Python"}],"dependencies":[{"reason":"Core OpenTelemetry SDK dependency","package":"opentelemetry-sdk","optional":false},{"reason":"Required for telemetry API","package":"opentelemetry-api","optional":false}],"imports":[{"note":"Main configurator class","symbol":"ElasticOpenTelemetryConfigurator","correct":"from elastic_opentelemetry import ElasticOpenTelemetryConfigurator"}],"quickstart":{"code":"import os\nos.environ['ELASTIC_OTEL_SERVICE_NAME'] = 'my-app'\nos.environ['ELASTIC_OTEL_ENDPOINT'] = 'https://my-elastic-cluster:443'\nos.environ['ELASTIC_OTEL_API_KEY'] = 'YOUR_API_KEY'\n\nfrom elastic_opentelemetry import ElasticOpenTelemetry\n\n# Initialize the Elastic OpenTelemetry configuration\nElasticOpenTelemetry().setup()","lang":"python","description":"Initialize the Elastic OpenTelemetry distribution with environment variables for service name, endpoint, and API key."},"warnings":[{"fix":"Set environment variable OTEL_TRACES_SAMPLER=always_on if you need to trace all requests.","message":"Starting from v1.5.0, the default sampler changed from `always_on` to `parentbased_traceidratio`. This may result in sampling decisions that drop some traces by default. To restore previous behavior, set `OTEL_TRACES_SAMPLER=always_on` explicitly.","severity":"breaking","affected_versions":">=1.5.0"},{"fix":"Install only `elastic-opentelemetry` for Elastic-optimized configuration.","message":"The package `elastic-opentelemetry` is the distribution package; do not confuse it with `opentelemetry-distro` or `opentelemetry-sdk`. Installing `elastic-opentelemetry` automatically pulls in the correct OpenTelemetry SDK and instrumentation packages.","severity":"gotcha","affected_versions":"all"},{"fix":"Set all environment variables before any telemetry setup code runs.","message":"Environment variables like `ELASTIC_OTEL_API_KEY` must be set before calling `ElasticOpenTelemetry().setup()`. Changing them afterward has no effect unless you reinitialize.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install elastic-opentelemetry` and use `from elastic_opentelemetry import ...` (note the underscore in the import).","cause":"The library is not installed or the import path is wrong.","error":"No module named 'elastic_opentelemetry'"},{"fix":"Use `from elastic_opentelemetry import ElasticOpenTelemetry` and instantiate as `ElasticOpenTelemetry().setup()`.","cause":"Using an older import path or misspelling the class name.","error":"AttributeError: module 'elastic_opentelemetry' has no attribute 'ElasticOpenTelemetry'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}