vmagent
Send data to Last9 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. Last9's remote-write endpoint.
Prerequisites
Create a Last9 cluster by following Getting Started.
Keep the following information handy after creating the cluster:
$levitate_remote_write_url
- Last9's Remote write endpoint$levitate_remote_write_username
- Cluster ID$levitate_remote_write_password
- Write token created for the cluster
Sending data to Last9
The information flow is as follows:
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 Last9.
Verification
The Last9 Cluster will start showing a summary of ingested samples.
Check out how to install VMAgent on Ubuntu as standalone serivce here.
Next steps
Create a read token for your Last9 Cluster and follow our guide to Configure Grafana to visualize the time series data getting sent to Last9.
Troubleshooting
Please get in touch with us on Discord or Email if you have any questions.