Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 6e84662

Browse files
committed
Link the official doc instead of repeating
1 parent 55fe9ae commit 6e84662

File tree

3 files changed

+14
-68
lines changed

3 files changed

+14
-68
lines changed

README.md

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -21,51 +21,16 @@ Key points to know:
2121
### Usage
2222

2323
To build k6 binary with the Prometheus remote write output extension use:
24-
2524
```
2625
xk6 build --with github.com/grafana/xk6-output-prometheus-remote@latest
2726
```
2827

29-
Then run new k6 binary with:
30-
31-
```
32-
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`):
3729
```
38-
K6_PROMETHEUS_RW_SERVER_URL=https://localhost:9090/api/v1/write \
39-
K6_PROMETHEUS_RW_INSECURE_SKIP_TLS_VERIFY=false \
40-
K6_PROMETHEUS_RW_USERNAME=foo \
41-
K6_PROMETHEUS_RW_PASSWORD=bar \
4230
./k6 run -o xk6-prometheus-rw script.js
4331
```
4432

45-
### Metric types conversions
46-
47-
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.
6934

7035
### Docker Compose
7136

@@ -108,23 +73,8 @@ Clone the repo to get started and follow these steps:
10873

10974
## Dashboards
11075

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.
113-
114-
### Test result dashboard
115-
11676
[<img src="./images/prometheus-dashboard-k6-test-result.png" width="500"/>](./images/prometheus-dashboard-k6-test-result.png)
11777

118-
Results can be filtered by:
119-
120-
- testid
121-
- scenario
122-
- url
123-
124-
[<img src="./images/prometheus-dashboard-k6-test-result-variables.png" width="500"/>](./images/prometheus-dashboard-k6-test-result-variables.png)
125-
126-
Response time metrics are based on the **metrics** variable, and the values can be:
127-
128-
- k6_http_req_duration_seconds (default)
129-
- k6_http_req_waiting_seconds
78+
The docker-compose setup comes with some pre-built Grafana dashboards. Check the [dashboard guide](/grafana/dashboards) for details.
13079

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

grafana/dashboards/README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
# Dashboards
22

33
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.
45

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.
106
>Note: The dashboards work with the Native Histogram mapping so it is required to enable it.
117
128
### Test result dashboard
139

14-
[<img src="./images/prometheus-dashboard-k6-test-result.png" width="500"/>](./images/prometheus-dashboard-k6-test-result.png)
10+
[<img src="/images/prometheus-dashboard-k6-test-result.png" width="500"/>](/images/prometheus-dashboard-k6-test-result.png)
1511

1612
Results can be filtered by:
1713

1814
- testid
1915
- scenario
2016
- url
2117

22-
[<img src="./images/prometheus-dashboard-k6-test-result-variables.png" width="500"/>](./images/prometheus-dashboard-k6-test-result-variables.png)
18+
[<img src="/images/prometheus-dashboard-k6-test-result-variables.png" width="500"/>](/images/prometheus-dashboard-k6-test-result-variables.png)
2319

2420
Response time metrics are based on the **metrics** variable, and the values can be:
2521

@@ -30,26 +26,26 @@ The board is structured into 4 sections
3026

3127
#### Performance Overview
3228

33-
[<img src="./images/prometheus-dashboard-k6-test-result-performance.png" width="500"/>](./images/prometheus-dashboard-k6-test-result-performance.png)
29+
[<img src="/images/prometheus-dashboard-k6-test-result-performance.png" width="500"/>](/images/prometheus-dashboard-k6-test-result-performance.png)
3430

3531
#### HTTP
3632

37-
[<img src="./images/prometheus-dashboard-k6-test-result-http.png" width="500"/>](./images/prometheus-dashboard-k6-test-result-http.png)
33+
[<img src="/images/prometheus-dashboard-k6-test-result-http.png" width="500"/>](/images/prometheus-dashboard-k6-test-result-http.png)
3834

3935
#### Scenarios
4036

41-
[<img src="./images/prometheus-dashboard-k6-test-result-scenarios.png" width="500"/>](./images/prometheus-dashboard-k6-test-result-scenarios.png)
37+
[<img src="/images/prometheus-dashboard-k6-test-result-scenarios.png" width="500"/>](/images/prometheus-dashboard-k6-test-result-scenarios.png)
4238

4339
### Test list dashboard
4440

45-
[<img src="./images/prometheus-dashboard-k6-test-runs.png" width="500"/>](./images/prometheus-dashboard-k6-test-runs.png)
41+
[<img src="/images/prometheus-dashboard-k6-test-runs.png" width="500"/>](/images/prometheus-dashboard-k6-test-runs.png)
4642

4743
>Note: This dashboard depends on the use of testid tag
4844
4945

50-
#### Apex Overview Dashboard
46+
#### Apdex Overview Dashboard
5147

52-
[<img src="./images/prometheus-dashboard-k6-test-result-apdex.png" width="500"/>](./images/prometheus-dashboard-k6-test-result-apdex.png)
48+
[<img src="/images/prometheus-dashboard-k6-test-result-apdex.png" width="500"/>](/images/prometheus-dashboard-k6-test-result-apdex.png)
5349

5450
The Apdex score is calculated based on your SLA ```([T]target time (seconds) Apdex
5551
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.
@@ -64,7 +60,7 @@ If you want to know more
6460
6561
#### Custom Metrics Example Dashboard
6662
67-
[<img src="./images/prometheus-dashboard-k6-test-result-apdex.png" width="500"/>](./images/prometheus-dashboard-k6-test-result-apdex.png)
63+
[<img src="/images/prometheus-dashboard-k6-test-result-apdex.png" width="500"/>](/images/prometheus-dashboard-k6-test-result-apdex.png)
6864
6965
This dashboard is an example of a dashboard with panels showing custom metrics.
7066
-298 KB
Loading

0 commit comments

Comments
 (0)