For the complete documentation index, see llms.txt. Markdown versions are available by appending .md to documentation URLs.

OpenTelemetry Environment Variables: Configure SDKs

SigNoz Cloud - This page applies to SigNoz Cloud editions.
Self-Host - This page applies to self-hosted SigNoz editions.

Overview

OpenTelemetry SDKs use environment variables to configure telemetry collection and export. This page explains the common variables for sending data to SigNoz.

Use this reference with a language-specific instrumentation guide. The guide shows which variables its SDK or agent supports.

Configure SigNoz Cloud

Set these variables in the process that runs your instrumented application:

export OTEL_SERVICE_NAME="<service-name>"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.<region>.signoz.cloud:443"
export OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"

Verify these values:

After you set the variables, restart your application. SigNoz Cloud accepts OTLP/HTTP and OTLP/gRPC on port 443.

Validate the configuration

Generate traffic for your application. Then validate each signal that your instrumentation produces:

  • Traces: Open Services and find the value of OTEL_SERVICE_NAME.
  • Logs: Open Logs Explorer and search for recent records from your service.
  • Metrics: Open Metrics Explorer and search for a metric from your instrumentation.

If data does not appear, use the troubleshooting section.

Core variables

VariablePurposeSigNoz Cloud value
OTEL_SERVICE_NAMESets the service.name resource attribute<service-name>
OTEL_EXPORTER_OTLP_ENDPOINTSets the base endpoint for OTLP exporthttps://ingest.<region>.signoz.cloud:443
OTEL_EXPORTER_OTLP_HEADERSAdds authentication headers to OTLP requestssignoz-ingestion-key=<your-ingestion-key>
OTEL_EXPORTER_OTLP_PROTOCOLSelects the OTLP transport and encodinghttp/protobuf

OTEL_SERVICE_NAME

OTEL_SERVICE_NAME sets the service.name resource attribute. SigNoz shows this value in the Services list.

If you do not set a service name, OpenTelemetry uses unknown_service:<executable-name>. If the executable name is unavailable, it uses unknown_service.

Use the same service name for all replicas of one service. Use different names for services that perform different functions.

OTEL_RESOURCE_ATTRIBUTES

OTEL_RESOURCE_ATTRIBUTES adds resource attributes to each span, metric, and log record. Use these attributes to describe the service and its environment.

export OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=production,service.version=1.4.2"

The value contains comma-separated key=value pairs. Percent-encode commas and equals signs that occur inside a key or value.

OTEL_SERVICE_NAME takes precedence over service.name in OTEL_RESOURCE_ATTRIBUTES.

OTEL_EXPORTER_OTLP_ENDPOINT

OTEL_EXPORTER_OTLP_ENDPOINT sets one base endpoint for traces, metrics, and logs. The endpoint behavior depends on the selected protocol.

For OTLP/HTTP, the SDK appends a path for each signal:

https://ingest.<region>.signoz.cloud:443/v1/traces
https://ingest.<region>.signoz.cloud:443/v1/metrics
https://ingest.<region>.signoz.cloud:443/v1/logs

For OTLP/gRPC, the SDK uses the endpoint as a gRPC target. Do not add an OTLP/HTTP signal path to a gRPC endpoint.

OTEL_EXPORTER_OTLP_HEADERS

OTEL_EXPORTER_OTLP_HEADERS adds headers to trace, metric, and log export requests. SigNoz Cloud uses signoz-ingestion-key for authentication.

export OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>"

Separate multiple headers with commas:

export OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>,x-tenant=acme"

The format follows the W3C Baggage header format. Semicolons cannot separate headers.

Do not add a Bearer prefix to the ingestion key. Do not use the deprecated signoz-access-token header.

OTEL_EXPORTER_OTLP_PROTOCOL

OTEL_EXPORTER_OTLP_PROTOCOL selects the transport and encoding. Set it because SDK defaults can differ.

ValueTransportSigNoz CloudSelf-hosted default
http/protobufProtobuf over HTTPPort 443Port 4318
grpcProtobuf over gRPCPort 443Port 4317
http/jsonJSON over HTTPPort 443Port 4318

An OTLP exporter must support grpc, http/protobuf, or both. Support for http/json is optional.

SigNoz documentation recommends http/protobuf. It is easier to configure across proxies and load balancers.

Signal-specific variables

If one signal needs a different endpoint or setting, use a signal-specific variable. The signal-specific value takes precedence for that signal.

The common signal-specific forms are:

All signalsTracesMetricsLogs
OTEL_EXPORTER_OTLP_ENDPOINTOTEL_EXPORTER_OTLP_TRACES_ENDPOINTOTEL_EXPORTER_OTLP_METRICS_ENDPOINTOTEL_EXPORTER_OTLP_LOGS_ENDPOINT
OTEL_EXPORTER_OTLP_HEADERSOTEL_EXPORTER_OTLP_TRACES_HEADERSOTEL_EXPORTER_OTLP_METRICS_HEADERSOTEL_EXPORTER_OTLP_LOGS_HEADERS
OTEL_EXPORTER_OTLP_PROTOCOLOTEL_EXPORTER_OTLP_TRACES_PROTOCOLOTEL_EXPORTER_OTLP_METRICS_PROTOCOLOTEL_EXPORTER_OTLP_LOGS_PROTOCOL
OTEL_EXPORTER_OTLP_TIMEOUTOTEL_EXPORTER_OTLP_TRACES_TIMEOUTOTEL_EXPORTER_OTLP_METRICS_TIMEOUTOTEL_EXPORTER_OTLP_LOGS_TIMEOUT
OTEL_EXPORTER_OTLP_COMPRESSIONOTEL_EXPORTER_OTLP_TRACES_COMPRESSIONOTEL_EXPORTER_OTLP_METRICS_COMPRESSIONOTEL_EXPORTER_OTLP_LOGS_COMPRESSION

For OTLP/HTTP, the SDK uses a signal-specific endpoint as written. Include the signal path in the value:

export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://ingest.<region>.signoz.cloud:443/v1/traces"

Transport variables

VariableDefaultPurpose
OTEL_EXPORTER_OTLP_TIMEOUT10000Sets the export timeout in milliseconds
OTEL_EXPORTER_OTLP_COMPRESSIONNo valueSelects gzip or none
OTEL_EXPORTER_OTLP_INSECUREfalseControls transport security for a gRPC endpoint without a scheme

An http:// or https:// endpoint scheme takes precedence over OTEL_EXPORTER_OTLP_INSECURE. OTLP/HTTP uses the endpoint scheme.

SigNoz Cloud does not require custom certificate variables. Self-hosted deployments with custom TLS can use these variables:

VariablePurpose
OTEL_EXPORTER_OTLP_CERTIFICATEPath to the trusted server certificate file
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATEPath to the client certificate file for mutual TLS
OTEL_EXPORTER_OTLP_CLIENT_KEYPath to the client private key file for mutual TLS

Exporter selection

VariableDefaultCommon values
OTEL_TRACES_EXPORTERotlpotlp, zipkin, console, none
OTEL_METRICS_EXPORTERotlpotlp, prometheus, console, none
OTEL_LOGS_EXPORTERotlpotlp, console, none
OTEL_SDK_DISABLEDfalsetrue, false

Use none to disable export for one signal. Use console for a short diagnostic test.

Sampling and propagation

VariableDefaultPurpose
OTEL_TRACES_SAMPLERparentbased_always_onSelects the trace sampler
OTEL_TRACES_SAMPLER_ARGNo valueSupplies an argument for the selected sampler
OTEL_PROPAGATORStracecontext,baggageSelects comma-separated context propagators

Common sampler values include:

always_on, always_off, traceidratio, parentbased_always_on, parentbased_always_off, parentbased_traceidratio

For ratio samplers, set OTEL_TRACES_SAMPLER_ARG to a number from 0 through 1. This example samples 10 percent of traces:

export OTEL_TRACES_SAMPLER="parentbased_traceidratio"
export OTEL_TRACES_SAMPLER_ARG="0.1"

Common propagator values include:

tracecontext, baggage, b3, b3multi, xray, none

Each pair of communicating services must share a propagation format. Otherwise, the receiving service starts a separate trace.

Batch and metric export variables

All durations in this section use milliseconds.

Traces

VariableDefaultPurpose
OTEL_BSP_SCHEDULE_DELAY5000Sets the delay between batch exports
OTEL_BSP_EXPORT_TIMEOUT30000Sets the time limit for one batch export
OTEL_BSP_MAX_QUEUE_SIZE2048Sets the maximum queued span count
OTEL_BSP_MAX_EXPORT_BATCH_SIZE512Sets the maximum spans in one batch

Logs

VariableDefaultPurpose
OTEL_BLRP_SCHEDULE_DELAY1000Sets the delay between batch exports
OTEL_BLRP_EXPORT_TIMEOUT30000Sets the time limit for one batch export
OTEL_BLRP_MAX_QUEUE_SIZE2048Sets the maximum queued log-record count
OTEL_BLRP_MAX_EXPORT_BATCH_SIZE512Sets the maximum log records in one batch

The maximum batch size must not exceed the queue size.

Metrics

VariableDefaultPurpose
OTEL_METRIC_EXPORT_INTERVAL60000Sets the interval between export attempts
OTEL_METRIC_EXPORT_TIMEOUT30000Sets the time limit for one export attempt

A shorter export interval shows new metrics sooner and increases the number of export requests.

These variables change the exported metric data model and which measurements become exemplars:

  • OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: Uses cumulative by default. It also accepts delta and lowmemory.
  • OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION: Uses explicit_bucket_histogram by default. It also accepts base2_exponential_bucket_histogram.
  • OTEL_METRICS_EXEMPLAR_FILTER: Selects which measurements attach exemplars. Uses trace_based by default. It also accepts always_on and always_off.
export OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE="delta"

SigNoz recommends delta for Counter, Async Counter, and Histogram instruments. A synchronous instrument that records nothing during an export interval then sends no data point for that interval, which lowers billable samples. UpDownCounter and Async UpDownCounter stay cumulative regardless of this setting. Gauge and Async Gauge have no aggregation temporality, so this setting does not affect them. See Use delta temporality for the full cost breakdown.

Attribute, span, and log record limits

The SDK truncates long attribute values and drops items that exceed count limits. Support for each limit varies by language.

VariableDefault
OTEL_ATTRIBUTE_COUNT_LIMIT128
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMITNo limit
OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT128
OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMITNo limit
OTEL_SPAN_EVENT_COUNT_LIMIT128
OTEL_SPAN_LINK_COUNT_LIMIT128
OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT128
OTEL_LINK_ATTRIBUTE_COUNT_LIMIT128
OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT128
OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMITNo limit

SigNoz Cloud rejects export requests larger than 16 MB. Self-hosted SigNoz sets its payload limit in the collector configuration; see payload size. If an export request exceeds the limit, reduce the batch size or attribute value length.

Configuration precedence

OpenTelemetry defines these precedence rules:

  • A signal-specific OTLP variable takes precedence over its general OTLP variable.
  • OTEL_SERVICE_NAME takes precedence over service.name in OTEL_RESOURCE_ATTRIBUTES.
  • An empty environment variable has the same effect as an unset variable.

The OpenTelemetry specification does not define universal precedence between programmatic and environment configuration. Review the behavior of your SDK.

Some SDKs support declarative configuration through OTEL_CONFIG_FILE. If the file does not reference a variable for substitution, the SDK ignores that variable.

OTEL_EXPERIMENTAL_CONFIG_FILE is the deprecated name for OTEL_CONFIG_FILE. Declarative configuration support remains limited across language SDKs.

Troubleshooting

Exports fail with 404 Not Found

Cause: The general OTLP/HTTP endpoint includes a signal path. The SDK appended the path again.

Resolution: Remove the path from OTEL_EXPORTER_OTLP_ENDPOINT:

export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.<region>.signoz.cloud:443"

Use a signal path with a signal-specific endpoint.

Exports fail with 401 or 403

Cause: The ingestion key header is missing or has an incorrect format.

Resolution: Set the SigNoz Cloud ingestion header:

export OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>"

Use the key value without a Bearer prefix.

The service appears as unknown_service

Cause: The application process did not receive OTEL_SERVICE_NAME.

Resolution: Export OTEL_SERVICE_NAME in the same process environment that starts the application. Then restart the application.

Exports time out or connections reset

Cause: The protocol does not match the self-hosted port, or the request exceeds a transport limit.

Resolution: Pair http/protobuf with port 4318 or grpc with port 4317. SigNoz Cloud uses port 443 for both protocols.

If the network is slow, increase OTEL_EXPORTER_OTLP_TIMEOUT. If requests are large, enable gzip and reduce the batch size.

A variable has no effect

Cause: The SDK does not support the variable, or another configuration source takes precedence.

Resolution: Review the OpenTelemetry compliance matrix. Then review the configuration rules for your SDK.

Inspect SDK export errors

If your SDK supports OTEL_LOG_LEVEL, set it to debug:

export OTEL_LOG_LEVEL="debug"

Read the application logs for the target endpoint and export errors. After the test, restore your previous log level.

Official OpenTelemetry references

Use these official sources:

Next Steps

Get Help

If you need help with the steps in this topic, please reach out to us on SigNoz Community Slack. If you are a SigNoz Cloud user, please use in product chat support located at the bottom right corner of your SigNoz instance or contact us at cloud-support@signoz.io.

Is this page helpful

Last updated—August 25, 2026

Edit on GitHub