Skip to content

Commit c22b9c7

Browse files
Update docs for new prometheus dashboards (#1344)
* WIP 1 * Complete Prometheus RW docs * Grafana Cloud Prometheus * Minor updates GC Prometheus * Update `Grafana Dashboards` page * Rewrite intro * Update src/data/markdown/translated-guides/en/04 Results output/200 Real-time/00 Grafana Cloud Prometheus.md Co-authored-by: Heitor Tashiro Sergent <[email protected]> * Update src/data/markdown/translated-guides/en/04 Results output/200 Real-time/00 Grafana Cloud Prometheus.md Co-authored-by: Heitor Tashiro Sergent <[email protected]> * Update src/data/markdown/translated-guides/en/04 Results output/300 Grafana dashboards.md Co-authored-by: Heitor Tashiro Sergent <[email protected]> * Update src/data/markdown/translated-guides/en/04 Results output/200 Real-time/00 Grafana Cloud Prometheus.md Co-authored-by: Heitor Tashiro Sergent <[email protected]> * Update command examples to skip `my_` or `your_` prefixes * Replace `utilize` for `use` --------- Co-authored-by: Heitor Tashiro Sergent <[email protected]>
1 parent 38423ec commit c22b9c7

9 files changed

+170
-126
lines changed

src/data/markdown/translated-guides/en/04 Results output/200 Real-time.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ You can also stream real-time metrics to the following services:
4040
- [Prometheus remote write](/results-output/real-time/prometheus-remote-write)
4141
- [TimescaleDB](/results-output/real-time/timescaledb)
4242
- [StatsD](/results-output/real-time/statsd)
43+
- [Other alternative with a custom output extension](/extensions/get-started/create/output-extensions/)
4344

4445
</Glossary>
4546

46-
> This list applies to local tests. To send k6 Cloud test results to an external service, refer to
47-
[Cloud APM](/cloud/integrations/cloud-apm/).
47+
> This list applies to local tests, not to [cloud tests](https://grafana.com/docs/grafana-cloud/k6/).
4848
4949

5050
## Read more

src/data/markdown/translated-guides/en/04 Results output/200 Real-time/00 Grafana Cloud Prometheus.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,48 @@ Select the **Details** of your Prometheus service.
4747
Now, pass the Username, API key, and Remote Write Endpoint of the Grafana Cloud Prometheus Configuration to the k6 binary:
4848

4949
```bash
50-
K6_PROMETHEUS_RW_USERNAME=Your_Username \
51-
K6_PROMETHEUS_RW_PASSWORD=Your_API_KEY \
52-
K6_PROMETHEUS_RW_SERVER_URL=Your_REMOTE_WRITE_ENDPOINT \
50+
K6_PROMETHEUS_RW_USERNAME=USERNAME \
51+
K6_PROMETHEUS_RW_PASSWORD=API_KEY \
52+
K6_PROMETHEUS_RW_SERVER_URL=REMOTE_WRITE_ENDPOINT \
5353
k6 run -o experimental-prometheus-rw script.js
5454
```
5555

56-
## Explore k6 metrics
56+
## Visualize test results
5757

58-
To explore k6 metrics in Grafana Cloud:
59-
1. Click on the Explore icon on the menu bar.
60-
1. Choose the Prometheus data source from the dropdown in the top left.
61-
1. In the query field, query k6 metrics to explore your testing results.
58+
To visualize test results with Grafana, you can import the [k6 Prometheus dashboard by Grafana k6](https://grafana.com/grafana/dashboards/19665-k6-prometheus/).
59+
60+
On the Dashboards UI:
61+
62+
- Click `New` and select `Import`.
63+
- Paste the Grafana URL or ID of the dashboard, and click `Load`.
64+
- Select the Prometheus data source, and click `Import`.
65+
66+
![k6 Prometheus Dashboard](./images/Prometheus/k6-prometheus-dashboard-part1.png)
67+
68+
Optionally, when running the test, you can set the `testid` tag as a [wide test tag](https://k6.io/docs/using-k6/tags-and-groups/#test-wide-tags) to filter results of a particular test run on this dashboard (or in PromQL queries). `testid` can be any unique string that allows you to identify the test run.
69+
70+
<CodeGroup labels={["Tag metrics with testid"]}>
71+
72+
```bash
73+
K6_PROMETHEUS_RW_USERNAME=USERNAME \
74+
K6_PROMETHEUS_RW_PASSWORD=API_KEY \
75+
K6_PROMETHEUS_RW_SERVER_URL=REMOTE_WRITE_ENDPOINT \
76+
k6 run -o experimental-prometheus-rw --tag testid=TEST_ID script.js
77+
```
78+
79+
</CodeGroup>
80+
81+
Additionally, you can also use the [Explore UI](https://grafana.com/docs/grafana/latest/explore/) to query k6 time series, design your visualization panels, and add them to any of your existing dashboards.
6282

6383
![Explore k6 metrics in Grafana Cloud](./images/GrafanaCloud/grafana_cloud_explore_k6_metrics_from_extension.png)
6484

65-
## Read more
85+
All the k6 time series have a **k6_** prefix.
86+
For more details, refer to the documentation on the [mapping of k6 metrics with Prometheus metrics](/results-output/real-time/prometheus-remote-write/#metrics-mapping).
87+
88+
It's also important to understand the default [Trend metric conversion](/results-output/real-time/prometheus-remote-write/#trend-metric-conversions) process and the format and querying limitations. The [`K6_PROMETHEUS_RW_TREND_STATS` option](/results-output/real-time/prometheus-remote-write/#options) allows you to convert trend metrics to multiple Prometheus time series. For instance, `K6_PROMETHEUS_RW_TREND_STATS=p(95),p(99),max,min` transforms each k6 trend metric into four Prometheus metrics as follows:
89+
90+
- `k6_*_p95`
91+
- `k6_*_p99`
92+
- `k6_*_max`
93+
- `k6_*_min`
6694

67-
- [K6 makes performance testing easy with Prometheus and Grafana in Docker](https://medium.com/@rody.bothe/turning-data-into-understandable-insights-with-k6-load-testing-fa24e326e221)

src/data/markdown/translated-guides/en/04 Results output/200 Real-time/00 Prometheus remote write.md

Lines changed: 116 additions & 105 deletions
Large diffs are not rendered by default.
506 KB
Loading
476 KB
Loading
522 KB
Loading
135 KB
Loading
121 KB
Loading

src/data/markdown/translated-guides/en/04 Results output/300 Grafana dashboards.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,21 @@ Having test results in a dashboard brings various benefits:
1212

1313
## Options
1414

15-
With [Grafana](https://grafana.com/grafana/), you can create a custom dashboard to query and **visualize data from multiple sources and any type of backend**. With k6, you can stream your test results to any backend using a [custom output extension](/extensions/get-started/create/output-extensions/) or an existing [real-time output](/results-output/real-time/#service).
15+
With [Grafana](https://grafana.com/grafana/), you can create a custom dashboard to query and **visualize data from multiple sources and any type of backend**.
16+
Using k6, you can [stream your local test results to any backend](/results-output/real-time).
17+
18+
The flexibility and interoperability of Grafana and k6 let you visualize test and observability data in one dashboard, regardless of where the data is stored.
19+
The following outputs include pre-built Grafana dashboards for their storage:
20+
21+
| Output | Grafana Dashboard |
22+
|---|---|
23+
| [AWSTimestream](https://github.com/leonyork/xk6-output-timestream) | [leonyork/xk6-output-timestream](https://github.com/leonyork/xk6-output-timestream/tree/main/grafana/dashboards/) |
24+
| [InfluxDB](/results-output/real-time/influxdb) | [grafana/xk6-output-influxdb](https://github.com/grafana/xk6-output-influxdb/tree/main/grafana/dashboards) |
25+
| [Prometheus remote write](/results-output/real-time/prometheus-remote-write) | [k6 Prometheus](https://grafana.com/grafana/dashboards/19665-k6-prometheus/) |
26+
| [Prometheus remote write (Native Histograms)](/results-output/real-time/prometheus-remote-write) | [k6 Prometheus (Native Histograms)](https://grafana.com/grafana/dashboards/18030-k6-prometheus-native-histograms/) |
27+
| [Grafana Cloud Prometheus](/results-output/real-time/grafana-cloud-prometheus/) | [k6 Prometheus](https://grafana.com/grafana/dashboards/19665-k6-prometheus/) |
28+
| [TimescaleDB](/results-output/real-time/timescaledb/) | [grafana/xk6-output-timescaledb](https://github.com/grafana/xk6-output-timescaledb/tree/main/grafana/dashboards) |
29+
| ---- | [More public dashboards from the community](https://grafana.com/grafana/dashboards/?search=k6) |
1630

17-
The flexibility and interoperability of Grafana and k6 let you join test and observability data in one dashboard, independently of where the data is stored.
18-
19-
For inspiration about how to build a custom dashboard that visualizes k6 results, browse the list of [community-built k6 dashboards](https://grafana.com/grafana/dashboards/?search=k6). The following outputs include pre-built Grafana dashboards for their storage:
20-
21-
- [AWSTimestream](https://github.com/leonyork/xk6-output-timestream)
22-
- [InfluxDB](/results-output/real-time/influxdb)
23-
- [Prometheus remote write](/results-output/real-time/prometheus-remote-write)
24-
- [TimescaleDB](/results-output/real-time/timescaledb/)
2531

2632
For a fully managed solution, [Grafana Cloud k6](https://grafana.com/products/cloud/k6/) is our commercial product to store, view, scale, and manage your tests with ease. It provides custom views to access your testing and analyze test results, enhanced collaboration features, and many more additional capabilities.

0 commit comments

Comments
 (0)