Parameters
See plugin common configurations for configuration options available to all plugins.
sampler
Sampling configuration.
name
vaild vaule:
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 follow the parent span's sampling decision, use
parent_base. If there is no parent span, the root sampler determines the decision.options
Parameters for sampling strategy.
fraction
Sampling fraction when the strategy is
trace_id_ratio. Values less than0are treated as0, while values greater than or equal to1sample every trace.root
Root sampler used when the strategy is
parent_baseand the span has no parent.name
vaild vaule:
always_on,always_off, ortrace_id_ratioRoot sampling strategy.
options
Root sampling strategy parameters.
fraction
Root sampling fraction when the strategy is
trace_id_ratio. Values less than0are treated as0, while values greater than or equal to1sample every trace.
additional_attributes
Names 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
Headers 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
trace_id_source
vaild vaule:
x-request-idorrandomSource of the trace ID. With
x-request-id, supply a nonzero 32-character hexadecimal trace ID. APISIX 3.18.0 and API7 Gateway 3.10.7 normalize and validate the candidate, falling back to a generated trace ID when it is invalid. API7 Gateway 3.9.20 does not validate an explicitly supplied header; when the header is absent, it uses the NGINX request ID.resource
Resource attributes to add to every span, for example,
{"service.name": "APISIX"}. If the object is present withoutservice.name, the plugin addsservice.name: APISIX.collector
Collector configurations.
address
Base address of the OpenTelemetry Collector. The plugin appends
/v1/tracesand uses HTTP when the address does not include a scheme.request_timeout
Request timeout to the OpenTelemetry Collector in seconds.
request_headers
Request headers to include when sending traces to the OpenTelemetry Collector, such as
{"Authorization": "token"}.
batch_span_processor
Batch span processor configurations.
drop_on_queue_full
If true, drop new spans when the queue is full. If false, process queued batches to make room.
max_queue_size
vaild vaule:
greater than
max_export_batch_sizeMaximum number of spans to buffer for delayed processing.
batch_timeout
vaild vaule:
greater than 0
Maximum time in seconds to wait while constructing a batch.
inactive_timeout
vaild vaule:
greater than 0
Interval in seconds for processing queued batches when the queue is not full.
max_export_batch_size
vaild vaule:
greater than 0 and less than
max_queue_sizeMaximum number of spans to process in one exported batch.
set_ngx_var
If true, populate the
opentelemetry_context_traceparent,opentelemetry_trace_id, andopentelemetry_span_idNGINX variables.