Elastic Distribution of OpenTelemetry Python
Project description
Elastic Distribution of OpenTelemetry Python
[!WARNING] The Elastic Distribution of OpenTelemetry Python is not yet recommended for production use. Functionality may be changed or removed in future releases. Alpha releases are not subject to the support SLA of official GA features.
We welcome your feedback! You can reach us by opening a GitHub issue or starting a discussion thread on the Elastic Discuss forum.
The Elastic Distribution of OpenTelemetry Python (EDOT Python) is a customized version of OpenTelemetry Python. EDOT Python makes it easier to get started using OpenTelemetry in your Python applications through strictly OpenTelemetry native means, while also providing a smooth and rich out of the box experience with Elastic Observability. It's an explicit goal of this distribution to introduce no new concepts in addition to those defined by the wider OpenTelemetry community.
With EDOT Python you have access to all the features of the OpenTelemetry Python agent plus:
- Access to improvements and bug fixes contributed by the Elastic team before the changes are available upstream in OpenTelemetry repositories.
- Access to optional features that can enhance OpenTelemetry data that is being sent to Elastic.
- Elastic-specific processors that ensure optimal compatibility when exporting OpenTelemetry signal data to an Elastic backend like an Elastic Observability deployment.
- Preconfigured collection of tracing and metrics signals, applying some opinionated defaults, such as which sources are collected by default.
Ready to try out EDOT Python? Follow the step-by-step instructions in Get started.
Read the docs
Install
pip install elastic-opentelemetry
Usage
Our distribution does not install any instrumentation package by default, instead it relies on the
opentelemetry-bootstrap
command to scan the installed packages and install the available instrumentation.
The following command will install all the instrumentations available for libraries found installed
in your environment:
opentelemetry-bootstrap --action=install
It will be useful to add this command every time you need to deploy an updated version of your application, e.g. into your container image build process.
At runtime you have to make some environment variables available to provide the needed configuration. A service name is required to have your app easily recognizable from the other. Then you need to provide the authorization headers for authentication with Elastic cloud and the project endpoint where to send your data.
OTEL_RESOURCE_ATTRIBUTES=service.name=<app-name>
OTEL_EXPORTER_OTLP_HEADERS="Authorization=<authorization header value>"
OTEL_EXPORTER_OTLP_ENDPOINT=<your elastic cloud url>
We are done with the configuration and the last piece of the puzzle is wrapping your service invocation with
opentelemetry-instrument
that is the wrapper that provides automatic instrumentation:
opentelemetry-instrument <command to start your service>
For a web service running with gunicorn it may looks like:
opentelemetry-instrument gunicorn main:app
Configuration
The distribution supports all the configuration variables from OpenTelemetry Python project version 1.28.2.
Default configuration variables
This distribution sets the following defaults:
OTEL_TRACES_EXPORTER
:otlp
OTEL_METRICS_EXPORTER
:otlp
OTEL_EXPORTER_OTLP_PROTOCOL
:grpc
OTEL_EXPERIMENTAL_RESOURCE_DETECTORS
:process_runtime,os,otel,telemetry_distro
OTEL_METRICS_EXEMPLAR_FILTER
:always_off
Distribution specific configuration variables
ELASTIC_OTEL_SYSTEM_METRICS_ENABLED
(default:false
): when sets totrue
sends system namespace metrics.
License
This software is licensed under the Apache License, version 2 ("Apache-2.0").
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file elastic_opentelemetry-0.4.1.tar.gz
.
File metadata
- Download URL: elastic_opentelemetry-0.4.1.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2d68a7c81102548ce5ca1e406d1feffc3a00e94985c1da6ccec379d6705fa00 |
|
MD5 | 8b99decc08ed2a7f9b0509e73ae763db |
|
BLAKE2b-256 | f82ec6fee984ecccdc0d0e8302aac0887a4b1a902fc975e6c5f277f141dee458 |
Provenance
The following attestation bundles were made for elastic_opentelemetry-0.4.1.tar.gz
:
Publisher:
release.yml
on elastic/elastic-otel-python
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
elastic_opentelemetry-0.4.1.tar.gz
- Subject digest:
f2d68a7c81102548ce5ca1e406d1feffc3a00e94985c1da6ccec379d6705fa00
- Sigstore transparency entry: 149876710
- Sigstore integration time:
- Predicate type:
File details
Details for the file elastic_opentelemetry-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: elastic_opentelemetry-0.4.1-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6e63f968fae192ebb034b1fbda12e9ed2fad9e2ff4a4a253ad2c71c40cf7feb |
|
MD5 | 8d1febeb5d46cb1695277a6b61267e2b |
|
BLAKE2b-256 | 707800629ed33df5c877ac000042ef5fadb57791d72f1dad76b3d15fb730e663 |
Provenance
The following attestation bundles were made for elastic_opentelemetry-0.4.1-py3-none-any.whl
:
Publisher:
release.yml
on elastic/elastic-otel-python
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
elastic_opentelemetry-0.4.1-py3-none-any.whl
- Subject digest:
b6e63f968fae192ebb034b1fbda12e9ed2fad9e2ff4a4a253ad2c71c40cf7feb
- Sigstore transparency entry: 149876713
- Sigstore integration time:
- Predicate type: