VictoriaLogs supports both client open-telemetry SDK and collector.
Client SDK #
Specify EndpointURL
for http-exporter builder to /insert/opentelemetry/v1/logs
.
Consider the following example for Go SDK:
|
|
VictoriaLogs treats all the resource labels as log stream fields.
The list of log stream fields can be overridden via VL-Stream-Fields
HTTP header if needed. For example, the following config uses only host
and app
labels as log stream fields, while the remaining labels are stored as regular log fields:
|
|
VictoriaLogs supports other HTTP headers - see the list here.
The ingested log entries can be queried according to these docs.
Collector configuration #
VictoriaLogs supports receiving logs from the following OpenTelemetry collectors:
Elasticsearch #
|
|
If Elasticsearch stores the log message in the field other than _msg
,
then it can be moved to _msg
field by using the VL-Msg-Field
HTTP header. For example, if the log message is stored in the Body
field,
then it can be moved to _msg
field via the following config:
|
|
VictoriaLogs supports other HTTP headers - see the list here.
OpenTelemetry #
Specify logs endpoint for OTLP/HTTP exporter in configuration file for sending the collected logs to VictoriaLogs:
|
|
VictoriaLogs 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 config instructs ignoring foo
and bar
fields during data ingestion:
|
|
See also: