Skip to content

dmasar/xk6-output-prometheus-remote

 
 

Repository files navigation

xk6-output-prometheus-remote

k6 extension for publishing test-run metrics to Prometheus via Remote Write endpoint.

🔖 As of k6 v0.42.0, this extension is available within k6 as an experimental module. This means that the extension has entered the process of being fully merged into the core of k6 and does not require a special build with xk6 to utilize this feature.

See the Prometheus remote write guide to utilize this feature.

There are many options for remote-write compatible agents, the official list can be found here. The exact details of how metrics will be processed or stored depends on the underlying agent used.

⚠️ Not to be confused with Prometheus Remote Write client extension which is for load testing Prometheus itself.

Usage

To build k6 binary with the Prometheus remote write output extension use:

xk6 build --with github.com/grafana/xk6-output-prometheus-remote@latest 

Then run new k6 binary with the following command for using the default configuration (e.g. remote write server url set to http://localhost:9090/api/v1/write):

./k6 run -o xk6-prometheus-rw script.js 

Check the documentation for advanced configurations, Docker Compose ready to use example or for using the builtin experimental output.

Dashboards

Pre-built Grafana dashboards are available. Check the dashboard guide how to import and use it from the source code or directly from Grafana.com.

Note: The dashboards work with the Native Histogram mapping so it is required to enable it.

About

K6 extension for Prometheus remote write

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.3%
  • Makefile 1.1%
  • Other 1.6%