User-defined Playground

VictoriaMetrics Cluster Playground

A multi-node VictoriaMetrics cluster with vminsert, vmselect, and vmstorage components.

Startup configuration
dev-machine
gateway
storage-01
storage-02
VictoriaMetrics Cluster playground: A multi-node VictoriaMetrics cluster with vminsert, vmselect, and vmstorage components.

💡 For use cases that don't require clustering, check out the single-node playground.

🔧 System Components

MachineComponentPortPurpose
gatewayvminsert8480Accepts incoming metrics and distributes them across storage nodes
gatewayvmselect8481Queries data from storage nodes and merges results
gatewayvmagent8429Scrapes metrics from cluster components and writes to vminsert
storage-01, storage-02vmstorage8482Stores time-series data on disk
VictoriaMetrics cluster components

VictoriaMetrics cluster components

🛠️ Tools

  • curl: Used to interact with the VictoriaMetrics HTTP API directly

🎯 Getting Started

Writing Metrics

From the dev-machine terminal:

Write a metric through vminsert:

curl -d 'my_custom_metric{env="playground"} 42' \
  http://gateway:8480/insert/0/prometheus/api/v1/import/prometheus

Querying Metrics

Query through vmselect:

curl -s 'http://gateway:8481/select/0/prometheus/api/v1/query?query=up' | jq

Query the custom metric written above:

curl -s 'http://gateway:8481/select/0/prometheus/api/v1/query?query=my_custom_metric' | jq

Querying with vmui

Open the vmui tab to access VictoriaMetrics' built-in query interface. It supports MetricsQL with autocompletion, query tracing, and a variety of visualization options.

Checking Cluster Health

Check vmstorage status on storage nodes (from dev-machine):

curl -s http://storage-01:8482/metrics | grep vm_rows
curl -s http://storage-02:8482/metrics | grep vm_rows

Check vmagent scrape targets:

curl -s http://gateway:8429/targets

💡 You can check the scrape config in the playground at /etc/vmagent/scrape.yaml.

📚 Learn More

🧪 Playgrounds

Happy learning! 🚀

Start
Settings