Skip to content

This repository demonstrates API metrics collection using a push-based method, sending data directly to VictoriaMetrics, and visualized with Grafana dashboards.

Notifications You must be signed in to change notification settings

crmspy/api_monitor_victoria

Repository files navigation

📊 API Monitoring with Push Method (Grafana + VictoriaMetrics)

Node.js License Prometheus Grafana VictoriaMetrics

This repository demonstrates API metrics collection using a push-based method, sending data directly to VictoriaMetrics, and visualized with Grafana dashboards.

  1. run victoriametrics docker run -d -p 8428:8428 --name victoriametrics victoriametrics/victoria-metrics

  2. Run Grafana docker run -d -p 3001:3000 grafana/grafana

  3. Run automatic hit api for data sample node tools push-api.js

  4. Open Grafana at http://localhost:3001/ victoria monitoring dashboard.json

🧾 Dashboard Import Instructions

1. Open Grafana

Go to your Grafana instance (e.g., http://localhost:3000) and:

  • Login (default: admin / admin)

2. Import the Dashboard

  • 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

📈 Panels Included

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)

🔍 PromQL Queries Used

You can customize or clone the panels using queries like:

Total Requests

sum(api_victoria_http_requests_total) by (method, route)

About

This repository demonstrates API metrics collection using a push-based method, sending data directly to VictoriaMetrics, and visualized with Grafana dashboards.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published