This repository demonstrates API metrics collection using a push-based method, sending data directly to VictoriaMetrics, and visualized with Grafana dashboards.
-
run victoriametrics docker run -d -p 8428:8428 --name victoriametrics victoriametrics/victoria-metrics
-
Run Grafana docker run -d -p 3001:3000 grafana/grafana
-
Run automatic hit api for data sample node tools push-api.js
-
Open Grafana at http://localhost:3001/ victoria monitoring dashboard.json
Go to your Grafana instance (e.g., http://localhost:3000) and:
- Login (default:
admin/admin)
- Go to Dashboards → Import
- Upload or paste the contents of
victoria monitoring dashboard.json - When prompted to select a data source, choose your VictoriaMetrics data source (must be configured as Prometheus type)
- Click Import
The dashboard contains the following visualizations:
| Panel Title | Description |
|---|---|
| Total HTTP Requests | Total number of requests grouped by method/route |
| Error Count | Total 4xx/5xx responses |
| Request Duration Histogram | Shows request latency buckets over time |
| P95 Latency per Route | 95th percentile latency grouped by route |
| Requests per Instance | Grouped by hostname + PID (via instance label) |
You can customize or clone the panels using queries like:
Total Requests
sum(api_victoria_http_requests_total) by (method, route)