You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 18, 2025. It is now read-only.
K6_PROMETHEUS_RW_SERVER_URL=http://localhost:9090/api/v1/write ./k6 run -o xk6-prometheus-rw script.js
33
-
```
34
-
35
-
Add TLS and HTTP basic authentication:
36
-
28
+
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`):
All the k6 metric types are converted into an equivalent Prometheus' type:
48
-
49
-
| k6 | Prometheus |
50
-
|----|------------|
51
-
| Counter | Counter |
52
-
| Gauge | Gauge |
53
-
| Rate | Gauge |
54
-
| Trend | Gauges / Native Histogram |
55
-
56
-
The obvious conversion with a classic Prometheus Histogram is not convenient because k6 can't determine the fixed buckets in advance, so the Output maps a Trend metric by default into a Gauge representing p(99). It is possible to map the same Trend to multiple stats at the same time (count, sum, min, max, avg, med, p(x)), it is possible to specify them via the `K6_PROMETHEUS_RW_TREND_STATS` environment variable (e.g `K6_PROMETHEUS_RW_TREND_STATS=avg,p(90),p(99),min,max`). Note that for each added stat a new time series will be generated.
57
-
Mapping Trend by stats has the following cons:
58
-
59
-
- It is impossible to aggregate some Gauge's value (especially the percentiles).
60
-
- It uses a memory-expensive k6's data structure.
61
-
62
-
The previous points can be resolved by mapping Trend as [Prometheus Native Histogram](https://prometheus.io/docs/concepts/metric_types/#histogram). Enabling the conversion by the `K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true` environment variable (or one of the other ways), then the Output converts all the Trend types into a dedicated Native Histogram.
63
-
64
-
Native Histogram is a Prometheus' experimental feature, so it has to be enabled (`--enable-feature=native-histograms`). Note that other Remote-write implementations don't support it yet.
65
-
66
-
### Prometheus as remote-write agent
67
-
68
-
To enable remote write in Prometheus 2.x use `--enable-feature=remote-write-receiver` option. See docker-compose samples in `example/`. Options for remote write storage can be found [here](https://prometheus.io/docs/operating/integrations/).
33
+
Check [the documentation](https://k6.io/docs/results-output/real-time/prometheus-remote-write) for advanced configurations.
69
34
70
35
### Docker Compose
71
36
@@ -108,23 +73,8 @@ Clone the repo to get started and follow these steps:
108
73
109
74
## Dashboards
110
75
111
-
The docker-compose setup comes with two pre-built Grafana dashboards. One for listing the discrete test runs as a list, and the other for visualizing the results of a specific test run.
112
-
>Note: The dashboards work with the Native Histogram mapping so it is required to enable it.
Copy file name to clipboardExpand all lines: grafana/dashboards/README.md
+10-14Lines changed: 10 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,21 @@
1
1
# Dashboards
2
2
3
3
Add custom dashboards here, then start the [docker-compose](../../docker-compose.yml) to have the dashboards provisioned at startup. Use folders to group related dashboards.
4
+
The docker-compose setup comes with some pre-built Grafana dashboards. One for listing the discrete test runs as a list, one for visualizing the results of a specific test run, and another for Apdex score.
4
5
5
-
6
-
7
-
## Dashboards
8
-
9
-
The docker-compose setup comes with two pre-built Grafana dashboards. One for listing the discrete test runs as a list, and the other for visualizing the results of a specific test run.
10
6
>Note: The dashboards work with the Native Histogram mapping so it is required to enable it.
The Apdex score is calculated based on your SLA ```([T]target time (seconds) Apdex
55
51
variable, default 0.3 sec)``` required where you can define a response time threshold of T seconds, where all responses handled in T seconds or less satisfy the end user.
0 commit comments