💡 To explore VictoriaMetrics cluster mode, check out the multi-node playground.
curl: Used to interact with the VictoriaMetrics HTTP API directlyWrite a metric using Prometheus text exposition format:
curl -d 'my_custom_metric{env="playground"} 42' http://localhost:8428/api/v1/import/prometheus
Write multiple metrics at once:
curl -d @- http://localhost:8428/api/v1/import/prometheus <<EOF
http_requests_total{method="GET",path="/"} 100
http_requests_total{method="POST",path="/api"} 25
EOF
Instant query:
curl -s "http://localhost:8428/api/v1/query?query=vm_app_uptime_seconds" | jq
Range query (last 2 minutes):
curl -s "http://localhost:8428/api/v1/query_range?query=vm_app_uptime_seconds&start=$(date -d '2 minutes ago' +%s)&end=$(date +%s)&step=15s" | jq
Query the custom metric written above:
curl -s 'http://localhost:8428/api/v1/query?query=my_custom_metric' | jq
Open the vmui tab to access VictoriaMetrics' built-in query interface. It supports MetricsQL with autocompletion, query tracing, and a variety of visualization options.
systemctl status victoriametrics
Happy learning! 🚀
💡 To explore VictoriaMetrics cluster mode, check out the multi-node playground.
curl: Used to interact with the VictoriaMetrics HTTP API directlyWrite a metric using Prometheus text exposition format:
curl -d 'my_custom_metric{env="playground"} 42' http://localhost:8428/api/v1/import/prometheus
Write multiple metrics at once:
curl -d @- http://localhost:8428/api/v1/import/prometheus <<EOF
http_requests_total{method="GET",path="/"} 100
http_requests_total{method="POST",path="/api"} 25
EOF
Instant query:
curl -s "http://localhost:8428/api/v1/query?query=vm_app_uptime_seconds" | jq
Range query (last 2 minutes):
curl -s "http://localhost:8428/api/v1/query_range?query=vm_app_uptime_seconds&start=$(date -d '2 minutes ago' +%s)&end=$(date +%s)&step=15s" | jq
Query the custom metric written above:
curl -s 'http://localhost:8428/api/v1/query?query=my_custom_metric' | jq
Open the vmui tab to access VictoriaMetrics' built-in query interface. It supports MetricsQL with autocompletion, query tracing, and a variety of visualization options.
systemctl status victoriametrics
Happy learning! 🚀