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.
Turning things on and off
Section titled “Turning things on and off”Nothing is sent anywhere until an endpoint is set or an exporter is named. Local log lines are on from the start.
| Variable | Default | What it does |
|---|---|---|
OTEL_SDK_DISABLED | false | true turns off traces, metrics and logs, and leaves only local log lines. |
OTEL_TRACES_EXPORTER | otlp once an endpoint is set, otherwise none | Where spans go: otlp, console (readable lines on standard output) or none. Several can be listed, separated by commas. |
OTEL_METRICS_EXPORTER | otlp once an endpoint is set, otherwise none | Where 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_EXPORTER | otlp once an endpoint is set, otherwise none | Where log records go: otlp, console or none. Local log lines are separate: see OXTEL_LOG_FORMAT. |
OTEL_CONFIG_FILE | unset | A 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. |
Local log lines
Section titled “Local log lines”What oxtel writes to the program’s own output, separately from what it exports.
| Variable | Default | What it does |
|---|---|---|
RUST_LOG | info | How 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_FORMAT | auto | How 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_OUTPUT | stderr | Where 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_MAPPINGS | all | none turns off the spans and metrics oxtel makes from what libraries already log, such as sqlx’s queries. |
Your service
Section titled “Your service”What every span, metric and log record says about where it came from.
| Variable | Default | What it does |
|---|---|---|
OTEL_SERVICE_NAME | unknown_service: and the executable’s name | The service’s name, as backends show it. It takes precedence over a service.name in OTEL_RESOURCE_ATTRIBUTES. |
OTEL_RESOURCE_ATTRIBUTES | unset | More 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_DETECTORS | all of them | Which detectors run at startup, separated by commas: service, host, os, process, container and k8s; or none. |
K8S_NODE_NAME | unset | The 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. |
Sending with OTLP
Section titled “Sending with OTLP”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.
| Variable | Default | What it does |
|---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | unset: nothing is sent. With an exporter named, http://localhost:4318, or http://localhost:4317 for gRPC | Where 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_PROTOCOL | http/protobuf | http/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_HEADERS | unset | Headers 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_COMPRESSION | none | gzip compresses what’s sent. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_COMPRESSION. |
OTEL_EXPORTER_OTLP_TIMEOUT | 10000 | How long each export may take, in milliseconds. Also per signal, such as OTEL_EXPORTER_OTLP_TRACES_TIMEOUT. |
OTEL_EXPORTER_OTLP_CERTIFICATE | the bundled root certificates | A 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_CERTIFICATE | unset | A 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_KEY | unset | A 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_PREFERENCE | cumulative | delta (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_AGGREGATION | explicit_bucket_histogram | base2_exponential_bucket_histogram makes OTLP’s histograms exponential. Prometheus scrapes are unchanged. |
Prometheus
Section titled “Prometheus”The built-in /metrics endpoint, served with OTEL_METRICS_EXPORTER=prometheus.
| Variable | Default | What it does |
|---|---|---|
OTEL_EXPORTER_PROMETHEUS_HOST | localhost | The address to listen on. 0.0.0.0 listens on every interface, as a scraper outside a container needs. |
OTEL_EXPORTER_PROMETHEUS_PORT | 9464 | The port to listen on. |
Sampling and propagation
Section titled “Sampling and propagation”Which traces are kept, and how a trace crosses from one service to the next.
| Variable | Default | What it does |
|---|---|---|
OTEL_TRACES_SAMPLER | parentbased_always_on | always_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_ARG | 1.0 | For the ratio samplers, the share of traces to keep, from 0 to 1. A ratio that isn’t one means 1.0. |
OTEL_PROPAGATORS | tracecontext,baggage | How trace context travels between services: tracecontext (W3C), baggage or none. Others are warned about and ignored. |
Batching and export intervals
Section titled “Batching and export intervals”When spans, log records and metrics are sent. Times are in milliseconds.
| Variable | Default | What it does |
|---|---|---|
OTEL_BSP_SCHEDULE_DELAY | 5000 | How often a batch of spans is sent. |
OTEL_BSP_MAX_QUEUE_SIZE | 2048 | How many spans wait to be sent. Beyond it, new spans are dropped and counted, rather than slowing the program. |
OTEL_BSP_MAX_EXPORT_BATCH_SIZE | 512 | The most spans sent at once. It can’t exceed the queue. |
OTEL_BSP_EXPORT_TIMEOUT | 30000 | How long sending a batch of spans may take. |
OTEL_BLRP_SCHEDULE_DELAY | 1000 | How often a batch of log records is sent. |
OTEL_BLRP_MAX_QUEUE_SIZE | 2048 | How many log records wait to be sent. Beyond it, new ones are dropped and counted. |
OTEL_BLRP_MAX_EXPORT_BATCH_SIZE | 512 | The most log records sent at once. |
OTEL_BLRP_EXPORT_TIMEOUT | 30000 | How long sending a batch of log records may take. |
OTEL_METRIC_EXPORT_INTERVAL | 60000 | How often metrics are pushed. Prometheus scrapes whenever it likes. |
OTEL_METRIC_EXPORT_TIMEOUT | 30000 | How long pushing metrics may take. |
OTEL_METRICS_EXEMPLAR_FILTER | trace_based | Which 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. |
Limits
Section titled “Limits”Caps that keep one runaway span or record from using unbounded memory. What’s over a limit is dropped.
| Variable | Default | What it does |
|---|---|---|
OTEL_ATTRIBUTE_COUNT_LIMIT | 128 | The most attributes on a span or log record, unless the more specific limits below say otherwise. |
OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | 128 | The most attributes on a span. |
OTEL_SPAN_EVENT_COUNT_LIMIT | 128 | The most events on a span. |
OTEL_SPAN_LINK_COUNT_LIMIT | 128 | The most links on a span. |
OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT | 128 | The most attributes on a log record. |
How this page is kept true
Section titled “How this page is kept true”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.