VictoriaMetrics and VictoriaLogs support ingestion metrics and logs in OpenTelemetry format. This guide covers examples of using opentelemetry-collector and direct pushing of metrics and logs from the Go application.
Pre-Requirements #
Installation #
VictoriaMetrics #
Install VictoriaMetrics helm repo:
|
|
Add VictoriaMetrics chart values to convert OTEL metric names to Prometheus canonical format:
|
|
Install VictoriaMetrics single-server version:
|
|
Verify it’s up and running:
|
|
VictoriaMetrics helm chart provides the following URL for writing data:
|
|
For OpenTelemetry VictoriaMetrics write endpoint is:
|
|
VictoriaLogs #
Install VictoriaLogs:
|
|
Verify it’s up and running:
|
|
VictoriaLogs helm chart provides the following URL for writing data:
|
|
For OpenTelemetry VictoriaLogs write endpoint is:
|
|
OpenTelemetry collector with VictoriaMetrics and VictoriaLogs #

Add OpenTelemetry helm repo:
|
|
Add OpenTelemetry Collector values:
|
|
Install OpenTelemetry Collector helm chart:
|
|
Check if OpenTelemetry Collector pod is up and running:
|
|
Forward VictoriaMetrics port to local machine to explore metrics ingested by the collector:
|
|
Visit http://localhost:8428/vmui/#/?g0.expr=k8s_container_ready to check if metric k8s_container_ready
is present.
Check other available metrics by visiting cardinality explorer page.
Forward VictoriaLogs port to local machine to explore logs ingested by the collector:
|
|
Visit http://localhost:9428/select/vmui to check if logs ingested by collector are present.
The full version of possible configuration options for the collector can be found in OpenTelemetry docs.
Sending metrics and logs from Go application #
Metrics and logs can be sent via OpenTelemetry instrumentation libraries. You can use any compatible OpenTelemetry instrumentation clients. In our example, we’ll create a WEB server in Golang, instrument it with metrics and logs and configure it to send telemetry data to OpenTelemetry collector. The collector will then forward received data to VictoriaMetrics or VictoriaLogs.
Sending to OpenTelemetry collector #
Create file main.go
from example that implements a dice roll WEB server instrumented with
OpenTelemetry SDK and is configured to send data to OpenTelemetry collector at http://localhost:4318 address.
See how to setup and run OpenTelemetry collector here.
In the same directory with the file create the go.mod
file and execute following commands:
|
|
Now try running the application:
|
|
By default, the application from example is listening at http://localhost:8080
. Start sending requests
to http://localhost:8080/rolldice endpoint to generate some metrics. The following command will send 20 requests:
|
|
After a few seconds you should start seeing metrics sent to VictoriaMetrics by visiting http://localhost:8428/vmui/#/?g0.expr=dice_rolls_total
in your browser or by querying the metric dice_rolls_total
in the UI interface.
Logs should be available by visiting http://localhost:9428/select/vmui
using query service.name: unknown_service:otel
.
Sending without OpenTelemetry collector #
Metrics and logs can be ingested into VictoriaMetrics and VictoriaLogs directly via HTTP requests. Use any compatible OpenTelemetry instrumentation clients.

In our example, we’ll create a WEB server in Golang, instrument it with metrics and logs and configure it to send this telemetry data to VictoriaMetrics and VictoriaLogs.
Create file main.go
from example. In the same directory with the file create the go.mod
file and execute following commands:
|
|
The example implements WEB server with two HTTP handlers: /api/slow
and /api/fast
. Start the application:
|
|
Make sure that VictoriaMetrics and VictoriaLogs are available locally at their default ports:
|
|
Visit application links http://localhost:8081/api/fast or http://localhost:8081/api/slow couple of times. The application will generate metrics and logs and will send them to VictoriaMetrics and VictoriaLogs.
After a few seconds you should start seeing metrics sent to VictoriaMetrics by visiting http://localhost:8428/vmui/#/?g0.expr=http_requests_total.

Check other available metrics by visiting cardinality explorer page.
Logs should be available by visiting http://localhost:9428/select/vmui
using query service.name: unknown_service:otel
.

Limitations #
- VictoriaMetrics and VictoriaLogs do not support experimental JSON encoding format.
- VictoriaMetrics supports only
AggregationTemporalityCumulative
type for histogram and summary. Either consider using cumulative temporality or trydelta-to-cumulative processor
to make conversion to cumulative temporality in OTEL Collector.