OpenTelemetry Configuration
Parameters
See plugin common configurations for configuration options available to all plugins.
-
sampler—object· optionalSampling configuration.
-
name—string· optional · default:always_offValid values:
always_on,always_off,trace_id_ratio, orparent_baseSampling strategy.
To always sample, use
always_on.To never sample, use
always_off.To randomly sample based on a given ratio, use
trace_id_ratio.To use to sampling decision of the span’s parent, use
parent_base. If there is no parent, use the root sampler. -
options—object· optionalParameters for sampling strategy.
-
fraction—number· optional · default:0Valid values: between 0 and 1 inclusive
Sampling ratio when the sampling strategy is
trace_id_ratio. -
root—object· optionalRoot sampler when the sampling strategy is
parent_basestrategy.-
name—string· optional · default:always_offValid values:
always_on,always_off, ortrace_id_ratioRoot sampling strategy.
-
options—object· optionalRoot sampling strategy parameters.
-
fraction—number· optional · default:0Valid values: between 0 and 1 inclusive
Root sampling ratio when the sampling strategy is
trace_id_ratio.
-
-
-
-
-
additional_attributes—array[string]· optionalNames of built-in variables to append to the trace span as string attributes. Values are resolved in the log phase, so variables populated late in request processing are available. Numeric and boolean values are converted to strings; boolean
falseis retained. -
additional_header_prefix_attributes—array[string]· optionalHeaders or header prefixes appended to the trace span as string attributes in the log phase. For example, use
x-my-headerorx-my-headers-*to include all headers with the prefixx-my-headers-. Multiple values for one header are joined with,.
Plugin Metadata
-
tracing—boolean· optional · default:trueGlobal flag to enable or disable tracing. When set to
false, no spans will be emitted regardless of per-route sampler configuration. -
trace_id_source—string· optional · default:randomValid values:
x-request-idorrandomSource of the trace ID. When set to
x-request-id, the value of thex-request-idheader will be used as the trace ID. -
resource—object· optionalAdditional resource to append to the trace, for example,
{"service_name": "APISIX"}. -
collector—object· optionalCollector configurations.
-
address—string· optional · default:127.0.0.1:4318Address of the OpenTelemetry collector to send traces to.
-
request_timeout—integer· optional · default:3Request timeout to OpenTelemetry collector in seconds.
-
request_headers—object· optionalRequest header to include in requests to OpenTelemetry collector, such as
{"Authorization": "token"}.
-
-
batch_span_processor—object· optionalBatch span processor configurations.
-
drop_on_queue_full—boolean· optionalIf true, drop span when the queue is full, otherwise force process batches.
-
max_queue_size—integer· optionalMaximum queue size to buffer spans for delayed processing.
-
batch_timeout—number· optionalTimeout for span batches to wait in the export queue before being sent, in seconds.
-
inactive_timeout—number· optionalTimeout for spans to wait in the export queue before being sent, if the queue is not full, in seconds.
-
max_export_batch_size—integer· optionalMaximum number of spans to include in a single batch sent to the OpenTelemetry collector.
-
-
set_ngx_var—boolean· optional · default:falseExport
opentelemetryvariables to built-in variables.