Configure the Python agent for Splunk Observability Cloud π
You can configure the Python agent from the Splunk Distribution of OpenTelemetry Python to suit your instrumentation needs. In most cases, modifying the basic configuration is enough to get started.
The following sections describe all available settings for configuring the Python agent, including options for activating new features that are unique to the Splunk Distribution of OpenTelemetry Python.
General settings π
The following settings are specific to the Splunk Distribution of OpenTelemetry Python:
Environment variable |
Description |
---|---|
|
A Splunk authentication token that lets exporters send data directly to Splunk Observability Cloud. Unset by default. Not required unless you need to send data to the Splunk Observability Cloud ingest endpoint. See Create and manage authentication tokens using Splunk Observability Cloud. |
|
Activates the addition of server trace information to HTTP response headers. For more information, see Server trace information. The default value is |
|
Activates application metrics collection. The default value is |
Trace configuration π
The following settings control tracing limits and attributes:
Environment variable |
Description |
---|---|
|
Activates tracer creation and autoinstrumentation. The default value is |
|
Name of the service or application youβre instrumenting. Takes precedence over the service name defined in the |
|
Comma-separated list of resource attributes added to every reported span. For example, |
|
Maximum number of attributes per span. The default value is unlimited. |
|
Maximum number of attributes per event. The default value is unlimited. |
|
Maximum number of attributes per link. The default value is unlimited. |
|
Maximum number of events per span. The default value is unlimited. |
|
Maximum number of links per span. The default value is |
|
Maximum length of strings for attribute values. Values larger than the limit are truncated. The default value is |
Exporters configuration π
The following settings control trace exporters and their endpoints:
Environment variable |
Description |
---|---|
|
Trace exporter to use. You can set multiple comma-separated values (for example, |
|
The metrics exporter to use. The default value is |
|
Interval, in milliseconds, between the start of two export attempts. The default value is |
|
Maximum allowed time to export data, in milliseconds. The default value is |
|
The OTLP endpoint. The default value is |
|
The OTLP endpoint. The default value is |
To send data directly to Splunk Observability Cloud bypassing the Collector, see Send data directly to Splunk Observability Cloud.
Propagators configuration π
The following settings control trace propagation:
Environment variable |
Description |
---|---|
|
Comma-separated list of propagators you want to use. The default value is |
For backward compatibility with the SignalFx Python Tracing Library, use the b3multi trace propagator:
export OTEL_PROPAGATORS=b3multi
$env:OTEL_PROPAGATORS=b3multi
Python settings for AlwaysOn Profiling π
Note
Only CPU profiling is supported.
The following settings control the AlwaysOn Profiling feature for the Python agent:
Environment variable |
Description |
---|---|
|
Activates AlwaysOn Profiling. The default value is |
|
The collector endpoint for profiler logs. By default, it takes the value of |
|
The frequency of call stack sampling, in milliseconds. The default value is |
|
Determines whether to include stack traces from internal profiler threads. The default value is |
Server trace information π
To connect Real User Monitoring (RUM) requests from mobile and web applications with server trace data, trace response headers are activated by default. The instrumentation adds the following response headers to HTTP responses:
Access-Control-Expose-Headers: Server-Timing
Server-Timing: traceparent;desc="00-<serverTraceId>-<serverSpanId>-01"
The Server-Timing
header contains the traceId
and spanId
parameters in traceparent
format. For more information, see the Server-Timing and traceparent documentation on the W3C website.
Note
If you need to deactivate trace response headers, set SPLUNK_TRACE_RESPONSE_HEADER_ENABLED
to false
.
Configure the Python agent in your code π
If you canβt set environment variables or canβt use splunk-py-trace
for setting configuration values at runtime, define the configuration settings in your code.
See Manually instrument Python applications for Splunk Observability Cloud for more information.