opentelemetry.sdk.environment_variables

opentelemetry.sdk.environment_variables.OTEL_RESOURCE_ATTRIBUTES = 'OTEL_RESOURCE_ATTRIBUTES'
OTEL_RESOURCE_ATTRIBUTES

The OTEL_RESOURCE_ATTRIBUTES environment variable allows resource attributes to be passed to the SDK at process invocation. The attributes from OTEL_RESOURCE_ATTRIBUTES are merged with those passed to Resource.create, meaning OTEL_RESOURCE_ATTRIBUTES takes lower priority. Attributes should be in the format key1=value1,key2=value2. Additional details are available in the specification.

$ OTEL_RESOURCE_ATTRIBUTES="service.name=shoppingcard,will_be_overridden=foo" python - <<EOF
import pprint
from opentelemetry.sdk.resources import Resource
pprint.pprint(Resource.create({"will_be_overridden": "bar"}).attributes)
EOF
{'service.name': 'shoppingcard',
'telemetry.sdk.language': 'python',
'telemetry.sdk.name': 'opentelemetry',
'telemetry.sdk.version': '0.13.dev0',
'will_be_overridden': 'bar'}
opentelemetry.sdk.environment_variables.OTEL_LOG_LEVEL = 'OTEL_LOG_LEVEL'
OTEL_LOG_LEVEL

The OTEL_LOG_LEVEL environment variable sets the log level used by the SDK logger Default: “info”

opentelemetry.sdk.environment_variables.OTEL_TRACES_SAMPLER = 'OTEL_TRACES_SAMPLER'
OTEL_TRACES_SAMPLER

The OTEL_TRACES_SAMPLER environment variable sets the sampler to be used for traces. Sampling is a mechanism to control the noise introduced by OpenTelemetry by reducing the number of traces collected and sent to the backend Default: “parentbased_always_on”

opentelemetry.sdk.environment_variables.OTEL_TRACES_SAMPLER_ARG = 'OTEL_TRACES_SAMPLER_ARG'
OTEL_TRACES_SAMPLER_ARG

The OTEL_TRACES_SAMPLER_ARG environment variable will only be used if OTEL_TRACES_SAMPLER is set. Each Sampler type defines its own expected input, if any. Invalid or unrecognized input is ignored, i.e. the SDK behaves as if OTEL_TRACES_SAMPLER_ARG is not set.

opentelemetry.sdk.environment_variables.OTEL_BSP_SCHEDULE_DELAY = 'OTEL_BSP_SCHEDULE_DELAY'
OTEL_BSP_SCHEDULE_DELAY

The OTEL_BSP_SCHEDULE_DELAY represents the delay interval between two consecutive exports. Default: 5000

opentelemetry.sdk.environment_variables.OTEL_BSP_EXPORT_TIMEOUT = 'OTEL_BSP_EXPORT_TIMEOUT'
OTEL_BSP_EXPORT_TIMEOUT

The OTEL_BSP_EXPORT_TIMEOUT represents the maximum allowed time to export data. Default: 30000

opentelemetry.sdk.environment_variables.OTEL_BSP_MAX_QUEUE_SIZE = 'OTEL_BSP_MAX_QUEUE_SIZE'
OTEL_BSP_MAX_QUEUE_SIZE

The OTEL_BSP_MAX_QUEUE_SIZE represents the maximum queue size for the data export. Default: 2048

opentelemetry.sdk.environment_variables.OTEL_BSP_MAX_EXPORT_BATCH_SIZE = 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE'
OTEL_BSP_MAX_EXPORT_BATCH_SIZE

The OTEL_BSP_MAX_EXPORT_BATCH_SIZE represents the maximum batch size for the data export. Default: 512

opentelemetry.sdk.environment_variables.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT = 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT'
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT

The OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT represents the maximum allowed attribute length.

opentelemetry.sdk.environment_variables.OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT = 'OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT'
OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT

The OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT represents the maximum allowed event attribute count. Default: 128

The OTEL_LINK_ATTRIBUTE_COUNT_LIMIT represents the maximum allowed link attribute count. Default: 128

opentelemetry.sdk.environment_variables.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT = 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT'
OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT

The OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT represents the maximum allowed span attribute count. Default: 128

opentelemetry.sdk.environment_variables.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT = 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT'
OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT

The OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT represents the maximum allowed length span attribute values can have. This takes precedence over OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT.

opentelemetry.sdk.environment_variables.OTEL_SPAN_EVENT_COUNT_LIMIT = 'OTEL_SPAN_EVENT_COUNT_LIMIT'
OTEL_SPAN_EVENT_COUNT_LIMIT

The OTEL_SPAN_EVENT_COUNT_LIMIT represents the maximum allowed span event count. Default: 128

The OTEL_SPAN_LINK_COUNT_LIMIT represents the maximum allowed span link count. Default: 128

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_JAEGER_AGENT_HOST = 'OTEL_EXPORTER_JAEGER_AGENT_HOST'
OTEL_EXPORTER_JAEGER_AGENT_HOST

The OTEL_EXPORTER_JAEGER_AGENT_HOST represents the hostname for the Jaeger agent. Default: “localhost”

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_JAEGER_AGENT_PORT = 'OTEL_EXPORTER_JAEGER_AGENT_PORT'
OTEL_EXPORTER_JAEGER_AGENT_PORT

The OTEL_EXPORTER_JAEGER_AGENT_PORT represents the port for the Jaeger agent. Default: 6831

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_JAEGER_ENDPOINT = 'OTEL_EXPORTER_JAEGER_ENDPOINT'
OTEL_EXPORTER_JAEGER_ENDPOINT

The OTEL_EXPORTER_JAEGER_ENDPOINT represents the HTTP endpoint for Jaeger traces. Default: “http://localhost:14250

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_JAEGER_USER = 'OTEL_EXPORTER_JAEGER_USER'
OTEL_EXPORTER_JAEGER_USER

The OTEL_EXPORTER_JAEGER_USER represents the username to be used for HTTP basic authentication.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_JAEGER_PASSWORD = 'OTEL_EXPORTER_JAEGER_PASSWORD'
OTEL_EXPORTER_JAEGER_PASSWORD

The OTEL_EXPORTER_JAEGER_PASSWORD represents the password to be used for HTTP basic authentication.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_JAEGER_TIMEOUT = 'OTEL_EXPORTER_JAEGER_TIMEOUT'
OTEL_EXPORTER_JAEGER_TIMEOUT

Maximum time the Jaeger exporter will wait for each batch export. Default: 10

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_ZIPKIN_ENDPOINT = 'OTEL_EXPORTER_ZIPKIN_ENDPOINT'
OTEL_EXPORTER_ZIPKIN_ENDPOINT

Zipkin collector endpoint to which the exporter will send data. This may include a path (e.g. http://example.com:9411/api/v2/spans).

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_ZIPKIN_TIMEOUT = 'OTEL_EXPORTER_ZIPKIN_TIMEOUT'
OTEL_EXPORTER_ZIPKIN_TIMEOUT

Maximum time (in seconds) the Zipkin exporter will wait for each batch export. Default: 10

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_PROTOCOL = 'OTEL_EXPORTER_OTLP_PROTOCOL'
OTEL_EXPORTER_OTLP_PROTOCOL

The OTEL_EXPORTER_OTLP_PROTOCOL represents the the transport protocol for the OTLP exporter.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_CERTIFICATE = 'OTEL_EXPORTER_OTLP_CERTIFICATE'
OTEL_EXPORTER_OTLP_CERTIFICATE

The OTEL_EXPORTER_OTLP_CERTIFICATE stores the path to the certificate file for TLS credentials of gRPC client. Should only be used for a secure connection.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_HEADERS = 'OTEL_EXPORTER_OTLP_HEADERS'
OTEL_EXPORTER_OTLP_HEADERS

The OTEL_EXPORTER_OTLP_HEADERS contains the key-value pairs to be used as headers associated with gRPC or HTTP requests.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_COMPRESSION = 'OTEL_EXPORTER_OTLP_COMPRESSION'
OTEL_EXPORTER_OTLP_COMPRESSION

Specifies a gRPC compression method to be used in the OTLP exporters. Possible values are:

If no OTEL_EXPORTER_OTLP_*COMPRESSION environment variable is present or compression argument passed to the exporter, the default grpc.Compression.NoCompression will be used. Additional details are available in the specification.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_TIMEOUT = 'OTEL_EXPORTER_OTLP_TIMEOUT'
OTEL_EXPORTER_OTLP_TIMEOUT

The OTEL_EXPORTER_OTLP_TIMEOUT is the maximum time the OTLP exporter will wait for each batch export. Default: 10

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_ENDPOINT = 'OTEL_EXPORTER_OTLP_ENDPOINT'
OTEL_EXPORTER_OTLP_ENDPOINT

The OTEL_EXPORTER_OTLP_ENDPOINT target to which the exporter is going to send spans or metrics. The endpoint MUST be a valid URL with scheme (http or https) and host, and MAY contain a port and path. A scheme of https indicates a secure connection. Default: “https://localhost:4317

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT = 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT'
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT

The OTEL_EXPORTER_OTLP_TRACES_ENDPOINT target to which the span exporter is going to send spans. The endpoint MUST be a valid URL with scheme (http or https) and host, and MAY contain a port and path. A scheme of https indicates a secure connection.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL = 'OTEL_EXPORTER_OTLP_TRACES_PROTOCOL'
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL

The OTEL_EXPORTER_OTLP_TRACES_PROTOCOL represents the the transport protocol for spans.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE = 'OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE'
OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE

The OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE stores the path to the certificate file for TLS credentials of gRPC client for traces. Should only be used for a secure connection for tracing.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_TRACES_HEADERS = 'OTEL_EXPORTER_OTLP_TRACES_HEADERS'
OTEL_EXPORTER_OTLP_TRACES_HEADERS

The OTEL_EXPORTER_OTLP_TRACES_HEADERS contains the key-value pairs to be used as headers for spans associated with gRPC or HTTP requests.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_TRACES_COMPRESSION = 'OTEL_EXPORTER_OTLP_TRACES_COMPRESSION'
OTEL_EXPORTER_OTLP_TRACES_COMPRESSION

Same as OTEL_EXPORTER_OTLP_COMPRESSION but only for the span exporter. If both are present, this takes higher precendence.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_OTLP_TRACES_TIMEOUT = 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT'
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT

The OTEL_EXPORTER_OTLP_TRACES_TIMEOUT is the maximum time the OTLP exporter will wait for each batch export for spans.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_JAEGER_CERTIFICATE = 'OTEL_EXPORTER_JAEGER_CERTIFICATE'
OTEL_EXPORTER_JAEGER_CERTIFICATE

The OTEL_EXPORTER_JAEGER_CERTIFICATE stores the path to the certificate file for TLS credentials of gRPC client for Jaeger. Should only be used for a secure connection with Jaeger.

opentelemetry.sdk.environment_variables.OTEL_EXPORTER_JAEGER_AGENT_SPLIT_OVERSIZED_BATCHES = 'OTEL_EXPORTER_JAEGER_AGENT_SPLIT_OVERSIZED_BATCHES'
OTEL_EXPORTER_JAEGER_AGENT_SPLIT_OVERSIZED_BATCHES

The OTEL_EXPORTER_JAEGER_AGENT_SPLIT_OVERSIZED_BATCHES is a boolean flag to determine whether to split a large span batch to admire the udp packet size limit.

opentelemetry.sdk.environment_variables.OTEL_SERVICE_NAME = 'OTEL_SERVICE_NAME'
OTEL_SERVICE_NAME

Convenience environment variable for setting the service name resource attribute. The following two environment variables have the same effect

OTEL_SERVICE_NAME=my-python-service

OTEL_RESOURCE_ATTRIBUTES=service.name=my-python-service

If both are set, OTEL_SERVICE_NAME takes precedence.