You can send k6 test results to a local Prometheus instance or a Grafana Cloud Prometheus instance.
To send k6 results to your local Prometheus instance:
-
Follow the instructions to run QuickPizza and observe it locally with Grafana OSS.
-
Execute the
k6 runcommand with the value of theoutputflag set toexperimental-prometheus-rwas follows:k6 run -o experimental-prometheus-rw 01.basic.js
The local Grafana instance includes the k6 Prometheus and k6 Prometheus (Native Histogram) dashboards to help visualize, query, and correlate k6 results with telemetry data.
For detailed instructions about the different options of the k6 Prometheus output, refer to the k6 output guide for Prometheus remote write.
To send k6 results to your Grafana Cloud Prometheus instance:
-
Follow the instructions to observe QuickPizza with Grafana Cloud.
-
Run the
k6execution command as in the local setup, including the additional settings:K6_PROMETHEUS_RW_USERNAME=USERNAME \ K6_PROMETHEUS_RW_PASSWORD=API_KEY \ K6_PROMETHEUS_RW_SERVER_URL=REMOTE_WRITE_ENDPOINT \ k6 run -o experimental-prometheus-rw script.js
For detailed instructions, refer to the k6 output guide for Grafana Cloud Prometheus.
