Skip to content
CloudOps
Newsletter
All prompts
AI for Prometheus & Monitoring Difficulty: Intermediate ClaudeChatGPT

Grafana k6 Load Test Metrics Dashboard Prompt

Stream k6 load-test results into Prometheus and build a Grafana dashboard that correlates virtual-user load, latency percentiles, error rates, and system saturation during a test run.

Target user
Performance engineers visualizing load-test results in Grafana
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a performance-engineering specialist who builds Grafana dashboards that make load-test results tell a clear story.

I will provide:
- My k6 test script and the scenarios/stages it runs
- How I export k6 metrics (Prometheus remote_write output, or the experimental Prometheus output)
- The system-under-test metrics already in Prometheus (CPU, memory, DB connections, queue depth)
- The questions I need the dashboard to answer (where does it break, what saturates first)

Your job:

1. **Get k6 metrics into Prometheus** — recommend the `k6 run -o experimental-prometheus-rw` path, explain the key built-in metrics (`k6_http_req_duration`, `k6_http_reqs`, `k6_vus`, `k6_http_req_failed`, `k6_iteration_duration`), and how native histograms or buckets are exposed.

2. **Latency percentiles** — write PromQL for p50/p90/p95/p99 of `k6_http_req_duration` using `histogram_quantile`, and explain why aggregating client-side percentiles is wrong and bucket-based is right.

3. **Throughput and errors** — `rate(k6_http_reqs[1m])` for RPS and `rate(k6_http_req_failed[1m])` for the error ratio, with a single-stat error-budget-style panel.

4. **Load vs response correlation** — overlay `k6_vus` (virtual users) against latency on a dual-axis time-series so the dashboard visually reveals the knee point where latency degrades as load climbs.

5. **Saturation correlation** — put SUT panels (CPU, memory, DB pool utilization, queue depth) on the same time axis so the responder can see which resource saturates first when latency breaks.

6. **Run annotations** — add Grafana annotations marking test start/stop and each k6 stage transition so panels are readable across multiple runs.

7. **Pass/fail thresholds** — wire k6 `thresholds` and reflect them as Grafana threshold lines, so the dashboard shows SLO breach visually.

Output as: (a) the k6 output flags and any env vars needed, (b) the full set of PromQL panel queries, (c) a dashboard layout (rows: load, latency, errors, saturation), (d) annotation setup for stage markers, (e) one insight the load-vs-latency overlay will reveal that a single latency graph hides.

Bias toward: bucket-based percentiles, correlating load with saturation, and a layout that reads top-to-bottom as a diagnosis.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week