k6 step-load rig: staircase scenarios, per-step/per-endpoint tagging, live Prometheus remote-write, Grafana dashboard

This commit is contained in:
Adam Carr
2026-09-20 11:12:03 -07:00
parent 2bc85826f1
commit 97d5cda6f9
5 changed files with 248 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboard-provider
namespace: monitoring
data:
dashboards.yaml: |
apiVersion: 1
providers:
- name: default
orgId: 1
folder: ""
type: file
disableDeletion: false
updateIntervalSeconds: 30
options:
path: /var/lib/grafana/dashboards
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboards
namespace: monitoring
data:
k6-step-load.json: |
{
"title": "k6 Step Load",
"uid": "k6step",
"timezone": "browser",
"refresh": "5s",
"time": { "from": "now-30m", "to": "now" },
"panels": [
{
"id": 1, "type": "timeseries", "title": "Request rate (the staircase)",
"gridPos": {"x": 0, "y": 0, "w": 24, "h": 8},
"targets": [
{"expr": "sum(rate(k6_http_reqs_total[30s]))", "legendFormat": "total rps"},
{"expr": "sum by (name) (rate(k6_http_reqs_total[30s]))", "legendFormat": "{{name}}"}
],
"fieldConfig": {"defaults": {"unit": "reqps"}, "overrides": []}
},
{
"id": 2, "type": "timeseries", "title": "Latency avg / p50 / p95 / p99",
"gridPos": {"x": 0, "y": 8, "w": 12, "h": 8},
"targets": [
{"expr": "k6_http_req_duration_avg", "legendFormat": "avg"},
{"expr": "k6_http_req_duration_p50", "legendFormat": "p50"},
{"expr": "k6_http_req_duration_p95", "legendFormat": "p95"},
{"expr": "k6_http_req_duration_p99", "legendFormat": "p99"}
],
"fieldConfig": {"defaults": {"unit": "ms"}, "overrides": []}
},
{
"id": 3, "type": "timeseries", "title": "p95 latency per step",
"gridPos": {"x": 12, "y": 8, "w": 12, "h": 8},
"targets": [
{"expr": "k6_http_req_duration_p95", "legendFormat": "{{step}}"}
],
"fieldConfig": {"defaults": {"unit": "ms"}, "overrides": []}
},
{
"id": 4, "type": "timeseries", "title": "p95 latency per endpoint",
"gridPos": {"x": 0, "y": 16, "w": 12, "h": 8},
"targets": [
{"expr": "k6_http_req_duration_p95", "legendFormat": "{{name}}"}
],
"fieldConfig": {"defaults": {"unit": "ms"}, "overrides": []}
},
{
"id": 5, "type": "timeseries", "title": "Error rate",
"gridPos": {"x": 12, "y": 16, "w": 12, "h": 8},
"targets": [
{"expr": "sum(rate(k6_http_req_failed_total[30s])) / sum(rate(k6_http_reqs_total[30s]))", "legendFormat": "error fraction"}
],
"fieldConfig": {"defaults": {"unit": "percentunit", "min": 0, "max": 1}, "overrides": []}
},
{
"id": 6, "type": "timeseries", "title": "Active VUs",
"gridPos": {"x": 0, "y": 24, "w": 24, "h": 6},
"targets": [{"expr": "k6_vus", "legendFormat": "vus"}],
"fieldConfig": {"defaults": {"unit": "short"}, "overrides": []}
}
],
"schemaVersion": 39,
"version": 1
}

View File

@@ -49,9 +49,15 @@ spec:
limits: {memory: 512Mi}
volumeMounts:
- {name: datasources, mountPath: /etc/grafana/provisioning/datasources}
- {name: dashboard-provider, mountPath: /etc/grafana/provisioning/dashboards}
- {name: dashboards, mountPath: /var/lib/grafana/dashboards}
volumes:
- name: datasources
configMap: {name: grafana-datasources}
- name: dashboard-provider
configMap: {name: grafana-dashboard-provider}
- name: dashboards
configMap: {name: grafana-dashboards}
---
apiVersion: v1
kind: Service

View File

@@ -84,6 +84,7 @@ spec:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.retention.time=15d
- --storage.tsdb.path=/data
- --web.enable-remote-write-receiver
ports:
- containerPort: 9090
resources: