Skip to main content

Grafana Dashboards

Grafana provides powerful visualization capabilities for k6 test results. By combining k6 metrics with application and system metrics in a single dashboard, you can quickly identify performance bottlenecks and analyze trends over time.

Benefits

Visualizing k6 results in Grafana offers several advantages:

Real-Time Monitoring

Watch test results as they stream in, identifying issues immediately

Historical Analysis

Compare test runs over time to track performance trends

Correlation

View k6 metrics alongside system metrics (CPU, memory) to find root causes

Customization

Create dashboards tailored to your specific needs and metrics
Grafana dashboard showing k6 results correlated with system metrics

Prerequisites

To visualize k6 results in Grafana, you need:
  1. Grafana - Either self-hosted or Grafana Cloud
  2. Storage backend - A database to store k6 metrics (InfluxDB, Prometheus, etc.)
  3. k6 output configuration - Stream metrics from k6 to your backend

Quick Start

Here’s a complete example using Docker Compose with InfluxDB and Grafana:
1

Create docker-compose.yml

docker-compose.yml
2

Start services

3

Build k6 with InfluxDB extension

4

Run k6 test

5

Access Grafana

Open http://localhost:3000 and import a pre-built dashboard

Pre-Built Dashboards

Several k6 outputs include ready-to-use Grafana dashboards:
Output: grafana/xk6-output-influxdbDashboards:
  • k6 Test Result Dashboard
  • k6 Test Comparison Dashboard
Import:
  1. Download dashboards from GitHub
  2. In Grafana: Dashboards → Import → Upload JSON file
  3. Select your InfluxDB data source
Features:
  • Real-time metrics visualization
  • Request rate and error rate
  • Response time percentiles
  • Virtual user activity
  • Data transfer rates

Dashboard Examples

Standard Metrics Dashboard

A typical k6 dashboard includes these panels: Performance Overview:
  • Response time (p50, p95, p99)
  • Request rate (requests/second)
  • Error rate (%)
  • Virtual users (active)
HTTP Metrics:
  • Request duration breakdown (blocked, connecting, TLS, sending, waiting, receiving)
  • Failed requests over time
  • Requests by status code
System Impact:
  • Data sent/received
  • Iterations per second
  • Iteration duration
Thresholds & Checks:
  • Threshold violations
  • Check success rate

Correlation Dashboard

Combine k6 metrics with application metrics:
This allows you to:
  • Identify when high load causes CPU spikes
  • Correlate response time degradation with database saturation
  • Match error rates with application errors

Creating Custom Dashboards

Build dashboards tailored to your specific needs:
Response time percentiles:
Request rate:
Error rate:

Best Practices

  • For live tests: Last 5-15 minutes
  • For analysis: Full test duration
  • For trends: Days or weeks
Set refresh interval to 5-10 seconds for real-time monitoring.
Create dashboard variables for:
  • Test run ID or tag
  • Scenario name
  • Environment (dev, staging, prod)
This makes dashboards reusable across different tests.
Mark important events on your graphs:
  • Deployment times
  • Configuration changes
  • Threshold violations
Use Grafana’s annotation features or log them as metrics.
Configure alerts for:
  • Error rate exceeds threshold
  • Response time degradation
  • Test failures
Send notifications to Slack, PagerDuty, or email.

Complete Example

Here’s a full workflow with InfluxDB and Grafana:

Grafana Cloud k6

For a fully managed solution, Grafana Cloud k6 provides:
  • Automatic metric storage and retention
  • Pre-built dashboards optimized for k6
  • Test management and scheduling
  • Team collaboration features
  • Cloud execution for distributed tests
  • No infrastructure to manage
Grafana Cloud k6 includes specialized views beyond standard Grafana dashboards, designed specifically for load testing workflows.

Community Dashboards

Explore more dashboards created by the community:

Next Steps

Real-Time Streaming

Learn how to stream metrics to your backend

Web Dashboard

Use the built-in k6 web dashboard

Grafana Docs

Explore Grafana’s documentation

InfluxDB Extension

View the InfluxDB output extension