Prometheus + Grafana

Ops integrations

Point loadr's Prometheus output at your stack and drop in the bundled Grafana dashboard to watch throughput, latency and errors live — a full docker-compose stack is included to try it end to end.

Browse all 52 demos 12 categories
Run it
$ loadr run examples/prometheus-grafana/loadr.yaml
examples/prometheus-grafana/loadr.yaml
# Live metrics in Prometheus + Grafana — Artillery's
# `prometheus-grafana-dashboards`.
#
# loadr exposes a Prometheus scrape endpoint while the test runs; Prometheus
# scrapes it (see prometheus.yml) and Grafana graphs it (grafana-dashboard.json).
# For a push model instead, drop `listen` and set `remote_write_url:`.
#
#   docker compose -f examples/prometheus-grafana/docker-compose.yml up -d
#   loadr run examples/prometheus-grafana/loadr.yaml
#   # Grafana: http://localhost:3000  (import grafana-dashboard.json)
name: prometheus-grafana
description: expose loadr metrics to Prometheus for live Grafana dashboards

defaults:
  http:
    base_url: https://api.example.com

scenarios:
  load:
    executor: constant-vus
    vus: 25
    duration: 10m
    think_time: { type: uniform, min: 200ms, max: 800ms }
    flow:
      - request: { name: list, url: /api/items, checks: [ { type: status, equals: 200 } ] }
      - request: { name: detail, url: /api/items/1, checks: [ { type: status, equals: 200 } ] }

outputs:
  # Prometheus scrapes this endpoint. 0.0.0.0 so the container can reach it.
  - { type: prometheus, listen: 0.0.0.0:9091 }

thresholds:
  http_req_duration: [ "p(95)<400" ]
  http_req_failed: [ "rate<0.02" ]

View raw: examples/prometheus-grafana/loadr.yaml

Related files: prometheus-grafana/docker-compose.yml · prometheus-grafana/grafana-dashboard.json · prometheus-grafana/README.md

What it shows

  • Prometheus remote-write / scrape
  • Bundled Grafana dashboard JSON
  • docker-compose stack to try locally