Skip to content

Every setting

oxtel reads the standard OpenTelemetry variables, and a few of its own that start with OXTEL_, so the people who run a program can change what it records and where it goes without a rebuild. A program can also make most of these choices in code, with oxtel::builder(); its documentation says which ones the environment overrides.

oxtel follows the specification’s variables and defaults with one deliberate exception: the specification sends to localhost:4318 even when nothing is set, and oxtel sends nothing until an endpoint is set or an exporter is named.

Nothing is sent anywhere until an endpoint is set or an exporter is named. Local log lines are on from the start.

VariableDefaultWhat it does
OTEL_SDK_DISABLEDfalsetrue turns off traces, metrics and logs, and leaves only local log lines.
OTEL_TRACES_EXPORTERotlp once an endpoint is set, otherwise noneWhere spans go: otlp, console (readable lines on standard output) or none. Several can be listed, separated by commas.
OTEL_METRICS_EXPORTERotlp once an endpoint is set, otherwise noneWhere metrics go: otlp, prometheus (a /metrics endpoint, at the host and port below), console or none. Several can be listed, separated by commas.
OTEL_LOGS_EXPORTERotlp once an endpoint is set, otherwise noneWhere log records go: otlp, console or none. Local log lines are separate: see OXTEL_LOG_FORMAT.
OTEL_CONFIG_FILEunsetA declarative configuration file (schema 1.x) to build every pipeline from, instead of these variables, which the file can still substitute with ${NAME}. Needs oxtel’s config feature, which is on by default. A file that can’t be read is an error.

What oxtel writes to the program’s own output, separately from what it exports.

VariableDefaultWhat it does
RUST_LOGinfoHow much is recorded, as directives such as info or info,hyper=warn. It applies to spans and exported log records too, unless the program sets their filters in code.
OXTEL_LOG_FORMATautoHow local log lines look: auto (text on a terminal, JSON otherwise), text, json (flat, with OpenTelemetry field names), ecs (Elastic Common Schema) or none.
OXTEL_LOG_OUTPUTstderrWhere local log lines go: stderr or stdout. Standard output is left alone by default, since it carries a command-line tool’s results and an MCP stdio server’s protocol.
OXTEL_MAPPINGSallnone turns off the spans and metrics oxtel makes from what libraries already log, such as sqlx’s queries.

What every span, metric and log record says about where it came from.

VariableDefaultWhat it does
OTEL_SERVICE_NAMEunknown_service: and the executable’s nameThe service’s name, as backends show it. It takes precedence over a service.name in OTEL_RESOURCE_ATTRIBUTES.
OTEL_RESOURCE_ATTRIBUTESunsetMore about the service, as key=value pairs separated by commas, such as deployment.environment.name=prod. They take precedence over what’s detected.
OTEL_EXPERIMENTAL_RESOURCE_DETECTORSall of themWhich detectors run at startup, separated by commas: service, host, os, process, container and k8s; or none.
K8S_NODE_NAMEunsetThe Kubernetes node, for k8s.node.name. Pass it into the pod through the downward API, from spec.nodeName. The namespace and pod are found without it.

Where and how OTLP exporters send. Each of these is also read for one signal, with TRACES_, METRICS_ or LOGS_ after OTEL_EXPORTER_OTLP_, and that one takes precedence.

VariableDefaultWhat it does
OTEL_EXPORTER_OTLP_ENDPOINTunset: nothing is sent. With an exporter named, http://localhost:4318, or http://localhost:4317 for gRPCWhere to send. Over HTTP, oxtel adds /v1/traces, /v1/metrics or /v1/logs; a signal’s own endpoint is used as it is, so it needs the full path. Over gRPC, it’s used as it is. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.
OTEL_EXPORTER_OTLP_PROTOCOLhttp/protobufhttp/protobuf, http/json, or grpc with oxtel’s grpc feature. Without the feature, grpc falls back to http/protobuf with a warning. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_PROTOCOL.
OTEL_EXPORTER_OTLP_HEADERSunsetHeaders to send, as key=value pairs separated by commas, such as Authorization=Bearer <token>. Values may be percent-encoded. Over gRPC they’re sent as metadata. A signal’s own headers are added to these, replacing any of the same name. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_HEADERS.
OTEL_EXPORTER_OTLP_COMPRESSIONnonegzip compresses what’s sent. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_COMPRESSION.
OTEL_EXPORTER_OTLP_TIMEOUT10000How long each export may take, in milliseconds. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_TIMEOUT.
OTEL_EXPORTER_OTLP_CERTIFICATEthe bundled root certificatesA PEM file of the certificates to verify the receiver with, in place of the bundled roots. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE.
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATEunsetA PEM file with a client certificate to present, for mutual TLS. It needs the key below. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE.
OTEL_EXPORTER_OTLP_CLIENT_KEYunsetA PEM file with the client certificate’s private key. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY.
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCEcumulativedelta (or lowmemory, the same for oxtel) makes OTLP’s counters and histograms report the change since the previous export. Other exporters keep their totals.
OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATIONexplicit_bucket_histogrambase2_exponential_bucket_histogram makes OTLP’s histograms exponential. Prometheus scrapes are unchanged.

The built-in /metrics endpoint, served with OTEL_METRICS_EXPORTER=prometheus.

VariableDefaultWhat it does
OTEL_EXPORTER_PROMETHEUS_HOSTlocalhostThe address to listen on. 0.0.0.0 listens on every interface, as a scraper outside a container needs.
OTEL_EXPORTER_PROMETHEUS_PORT9464The port to listen on.

Which traces are kept, and how a trace crosses from one service to the next.

VariableDefaultWhat it does
OTEL_TRACES_SAMPLERparentbased_always_onalways_on, always_off, traceidratio, parentbased_always_on, parentbased_always_off or parentbased_traceidratio. The parentbased_ ones follow the caller’s decision when there is one.
OTEL_TRACES_SAMPLER_ARG1.0For the ratio samplers, the share of traces to keep, from 0 to 1. A ratio that isn’t one means 1.0.
OTEL_PROPAGATORStracecontext,baggageHow trace context travels between services: tracecontext (W3C), baggage or none. Others are warned about and ignored.

When spans, log records and metrics are sent. Times are in milliseconds.

VariableDefaultWhat it does
OTEL_BSP_SCHEDULE_DELAY5000How often a batch of spans is sent.
OTEL_BSP_MAX_QUEUE_SIZE2048How many spans wait to be sent. Beyond it, new spans are dropped and counted, rather than slowing the program.
OTEL_BSP_MAX_EXPORT_BATCH_SIZE512The most spans sent at once. It can’t exceed the queue.
OTEL_BSP_EXPORT_TIMEOUT30000How long sending a batch of spans may take.
OTEL_BLRP_SCHEDULE_DELAY1000How often a batch of log records is sent.
OTEL_BLRP_MAX_QUEUE_SIZE2048How many log records wait to be sent. Beyond it, new ones are dropped and counted.
OTEL_BLRP_MAX_EXPORT_BATCH_SIZE512The most log records sent at once.
OTEL_BLRP_EXPORT_TIMEOUT30000How long sending a batch of log records may take.
OTEL_METRIC_EXPORT_INTERVAL60000How often metrics are pushed. Prometheus scrapes whenever it likes.
OTEL_METRIC_EXPORT_TIMEOUT30000How long pushing metrics may take.
OTEL_METRICS_EXEMPLAR_FILTERtrace_basedWhich measurements keep the trace and span ids of the span they were made in: trace_based (those in a sampled span), always_on or always_off.

Caps that keep one runaway span or record from using unbounded memory. What’s over a limit is dropped.

VariableDefaultWhat it does
OTEL_ATTRIBUTE_COUNT_LIMIT128The most attributes on a span or log record, unless the more specific limits below say otherwise.
OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT128The most attributes on a span.
OTEL_SPAN_EVENT_COUNT_LIMIT128The most events on a span.
OTEL_SPAN_LINK_COUNT_LIMIT128The most links on a span.
OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT128The most attributes on a log record.

It’s generated from a table in the repository’s xtask, which CI checks against the code on every change: every OTEL_ or OXTEL_ name the code reads has to be in the table, and every setting in the table has to be read where the table says. A setting can’t be added, renamed or dropped without this page following.