K6 missing browser module metrics in Prometheus(p90, 95, min, max ...)

Hi everybody, I am facing an issue when trying to retrieve metrics for the browser module from Prometheus. I have enabled histograms, but I am still unable to obtain my prefixed metrics such as _p95, p99. Here are my metrics from Prometheus:

I have not found information in the official documentation on how to make it work. Are summaryTrendStats acceptable for K6 browser module metrics when using Prometheus remote write?

Hi @samvel33651,

Can I have more information on how you set this up? Docker compose files, the command line you use to run the tests, anything to try and replicate your environment.

I’m not up to speed on the prometheus-remote-write output, so bear with me. I did the following and I was able to view the _p99 (which by default you should get) and when working with K6_PROMETHEUS_RW_TREND_STATS I was able to retrieve all the metrics that I had listed in the env var.

  1. Copy this docker-compose file.
  2. Run it with docker compose up -d prometheus grafana.
  3. Download the latest release of k6.
  4. Run the example fillform.js with the following command: ./k6 run -o experimental-prometheus-rw fillform.js.
  5. Navigate to http://localhost:9090/ and search for metrics prefxied with K6_.

Running it with K6_PROMETHEUS_RW_TREND_STATS like so K6_PROMETHEUS_RW_TREND_STATS=p(95),p(99),min,max ./k6 run -o experimental-prometheus-rw fillform.js resulted in the expected metrics that I had configured:


EDIT: It might be useful to work with prometheus’s native histogram instead. How to do that is outlined in step 2 of Send test metrics to a remote write endpoint.