OpenTelemetry SiteCustomize Instrumentation
Automatic OpenTelemetry instrumentation via Python's sitecustomize mechanism. Designed for environments where modifying the application startup command is difficult or impossible: managed runtimes, serverless platforms, job schedulers, and similar constrained settings. Install the package and instrumentation is applied automatically at Python startup, no wrapper command required.
When to Use This
The opentelemetry-instrument CLI is the standard way to auto-instrument a Python application. This package is for situations where wrapping your command with the CLI is not feasible, or requires tedious workarounds.
Note: If you control your application's startup command, prefer the
opentelemetry-instrumentCLI. This package is specifically designed for cases where that is not practical.
Installation
pip install opentelemetry-sitecustomize
or
uv add opentelemetry-sitecustomize
You will also need to install the OpenTelemetry instrumentors for the libraries you use. For example:
pip install opentelemetry-instrumentation-flask opentelemetry-instrumentation-requests
Usage
With the package installed, simply run your application as usual:
python app.py
No need for:
opentelemetry-instrument python app.py
OpenTelemetry instrumentation is applied automatically at Python startup.
Configuration
This package uses the same initialization path as the opentelemetry-instrument CLI, so all standard OpenTelemetry environment variables apply:
OTEL_SERVICE_NAME- set the service name for your tracesOTEL_TRACES_EXPORTER- choose the trace exporter (e.g.,otlp,console,none)OTEL_METRICS_EXPORTER- choose the metrics exporterOTEL_LOGS_EXPORTER- choose the logs exporterOTEL_EXPORTER_OTLP_ENDPOINT- set the OTLP collector endpointOTEL_PYTHON_DISABLED_INSTRUMENTATIONS- comma-separated list of instrumentations to skip
See the OpenTelemetry Python documentation for the full list of supported environment variables.
How It Works
This package registers a sitecustomize entrypoint that calls opentelemetry.instrumentation.auto_instrumentation:initialize during Python's site initialization. This is the same initialization function used by the opentelemetry-instrument CLI, but triggered automatically via the sitecustomize-entrypoints library.
Requirements
- Python >= 3.9
- sitecustomize-entrypoints ~= 1.0
- opentelemetry-api >= 1.25
- opentelemetry-instrumentation >= 0.46b0
License
Apache-2.0
Metadata
Release files for opentelemetry-sitecustomize 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| opentelemetry_sitecustomize-0.1.0.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opentelemetry_sitecustomize-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / opentelemetry_sitecustomize-0.1.0.tar.gz
| Download URL | opentelemetry_sitecustomize-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef1c747342f4edb5060159e38a1ae2d1fe35667af84e3124d911123c17f546b0
|
|
BLAKE2b-256 checksum How to use checksums |
dabdbfde2da5d93aed482db2c19addc41d065bd9eca4fbac8267ea8b08f8044e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.
Transparency logRelease files / opentelemetry_sitecustomize-0.1.0-py3-none-any.whl
| Download URL | opentelemetry_sitecustomize-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d467634f5d611a44c474ccf3f1cd9380d3bfbbf350f8f233554190348374d5c
|
|
BLAKE2b-256 checksum How to use checksums |
bf71eb207e9b84910f39fd5b5c05042d8e8f083ea572f0c8b2fc9e00b7e84221
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.
Transparency log