Skip to main content

vmagent

Send data to Levitate via VictoriaMetrics vmagent using Prometheus Remote Write protocol

We make use of the VictoriaMetrics' vmagent remote-write to write to an external remote endpoint i.e. Levitate's remote-write endpoint.

Prerequisites

Create a Levitate cluster by following Getting Started.

Keep the following information handy after creating the cluster:

  • $levitate_remote_write_url - Levitate's Remote write endpoint
  • $levitate_remote_write_username - Cluster ID
  • $levitate_remote_write_password - Write token created for the cluster

Sending data to Levitate

The information flow is as follows:

Sending metrics to Levitate via vmagent

Setup

Here is a sampledocker-compose.yaml for the vmagent setup:

version: "3.5"
services:
vmagent:
container_name: vmagent
image: victoriametrics/vmagent
ports:
- 8429:8429
volumes:
- vmagentdata:/vmagentdata
- /var/tmp:/var/tmp
- ./vmagent.yaml:/etc/vmagent/vmagent.yaml
command:
- "--promscrape.config=/etc/vmagent/vmagent.yaml"
- "--remoteWrite.tmpDataPath=/var/tmp/vmagent/"
- "--remoteWrite.maxDiskUsagePerURL=10737418240"
- "--remoteWrite.url=$levitate_remote_write_url"
- "--remoteWrite.basicAuth.username=$levitate_remote_write_username"
- "--remoteWrite.basicAuth.password=$levitate_remote_write_password"
restart: always
network_mode: "host"
volumes:
vmagentdata: { }

Create vmagent.yaml to add a sample scrape config. Replace this scrape config with your desired config:

global:
scrape_interval: 1m
scrape_timeout: 20s

# Check https://prometheus.io/docs/prometheus/latest/configuration/configuration for more details
scrape_configs:
- job_name: "vmagent"
static_configs:
- targets: [ "localhost:8429" ]

This will run the vmagent container, scrape the desired targets, and remote write metrics to Levitate.

Verification

The Levitate Cluster will start showing a summary of ingested samples.

Levitate Cluster's Performance metrics

tip

Check out how to install VMAgent on Ubuntu as standalone serivce here.

Next steps

Create a read token for your Levitate Cluster and follow our guide to Configure Grafana to visualize the time series data getting sent to Levitate.

Troubleshooting

Please get in touch with us on Discord or Email if you have any questions.