The Splunk distribution of OpenTelemetry Python provides multiple installable packages that automatically instrument your Python application to capture and report distributed traces to Splunk APM. Instrumentation works by patching supported libraries at runtime with an OpenTelemetry-compatible tracer to capture and export trace spans.
This distribution comes with the following defaults:
- OTLP gRPC exporter
configured to send spans to a locally running
Splunk OpenTelemetry Collector
(
http://localhost:4317). - Unlimited default limits for configuration options to support full-fidelity traces.
- Inclusion of system metrics
This Splunk Distribution of OpenTelemetry requires Python 3.10 or later. Supported libraries are listed here.
For complete instructions on how to get started with the Splunk Distribution of OpenTelemetry Python, see Instrument a Python application for Splunk Observability Cloud in the official documentation.
For the standard OpenTelemetry setup, install the Splunk distribution in your application environment. The distribution configures OTLP exporters for traces, metrics, and logs, includes system metrics instrumentation, and enables Python logging instrumentation.
pip install splunk-opentelemetryInstall instrumentation packages for the libraries your application uses:
opentelemetry-bootstrap -a installThen run your application with opentelemetry-instrument:
OTEL_SERVICE_NAME=my-python-service opentelemetry-instrument python app.pyBy default, OTLP exporters send telemetry to a locally running
Splunk OpenTelemetry Collector
at http://localhost:4317. To send telemetry directly to Splunk Observability
Cloud instead, set SPLUNK_REALM and SPLUNK_ACCESS_TOKEN before starting your
application. SPLUNK_REALM configures direct ingest endpoints for traces and
metrics.
To also install the Cisco SecureApp
OpenTelemetry extension, specify the secureapp extra:
pip install "splunk-opentelemetry[secureapp]"This extra installs the SecureApp Python agent, which reports runtime Python package dependencies through OpenTelemetry logs.
SecureApp dependency logs use the secureapp instrumentation scope. Collector
deployments must route those logs to the SecureApp event ingest endpoint
(/v3/event) and add the SecureApp instrumentation header on the outbound
exporter. See docs/secureapp.md for setup details and
docs/examples/secureapp-collector-config.yaml
for a collector example.
The Splunk distribution of OpenTelemetry Python Instrumentation is a distribution of OpenTelemetry Python. It is licensed under the terms of the Apache Software License version 2.0. See the license file for more details.
ℹ️ The Splunk Distribution of OpenTelemetry Python version 1.X is deprecated as of February 28, 2025 and will reach end of support on February 28, 2026. Existing customers should consider migrating to Splunk OpenTelemetry Python 2.0 or higher. See Migrate to the Splunk Python 2.0 instrumentation.