VictoriaTraces supports both client open-telemetry SDK and collector .
Client SDK #
The OpenTelemetry provides detailed document and examples for various programming languages:
To send data to VictoriaTraces, specify the EndpointURL
for http-exporter builder to http://<victoria-traces>:10428/insert/opentelemetry/v1/traces
.
Consider the following example for Go SDK:
traceExporter, err := otlptracehttp.New(ctx,
otlptracehttp.WithEndpointURL("http://<victoria-traces>:10428/insert/opentelemetry/v1/traces"),
)
VictoriaTraces automatically use service.name
in resource attributes and name
in span as
stream fields
.
While the remaining data (including resource
, instrumentation scope
, and fields in span
, like trace_id
, span_id
, span attributes
and more) are stored as
regular fields
:
VictoriaTraces supports other HTTP headers - see the list here .
The ingested trace spans can be queried according to these docs .
Collector configuration #
VictoriaTraces supports receiving traces from the following OpenTelemetry collector:
OpenTelemetry #
To send the collected traces to VictoriaTraces, specify traces endpoint for OTLP/HTTP exporter in configuration file:
exporters:
otlphttp:
traces_endpoint: http://<victoria-traces>:10428/insert/opentelemetry/v1/traces
VictoriaTraces supports various HTTP headers, which can be used during data ingestion - see the list
here
.
These headers can be passed to OpenTelemetry exporter config via headers
options. For example, the following configs add (or overwrites) foo: bar
field to each trace span during data ingestion:
exporters:
otlphttp:
traces_endpoint: http://<victoria-traces>:10428/insert/opentelemetry/v1/traces
headers:
VL-Extra-Fields: foo=bar
See also: