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
Copy file name to clipboardExpand all lines: docs/sources/k6/next/results-output/real-time/influxdb.md
+22-6Lines changed: 22 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,30 @@
1
1
---
2
2
title: 'InfluxDB'
3
-
description: 'k6 has an output extension to store k6 metrics in InfluxDB v2. This document shows you how to configure this integration.'
3
+
description: 'k6 has built-in support for InfluxDB v1, and provides an output extension to store k6 metrics in InfluxDB v2. This document shows you how to configure this integration.'
4
4
weight: 00
5
5
---
6
6
7
7
# InfluxDB
8
8
9
+
k6 supports sending output metrics to InfluxDB v1.0 and v2.0.
10
+
11
+
## Send k6 metrics to InfluxDB v1.0
12
+
13
+
k6 has built-in support to send metrics to InfluxDB v1.0.
14
+
15
+
You can use the `--out` flag with the `influxdb` option:
16
+
17
+
```bash
18
+
k6 run --out influxdb=http://localhost:8086/myk6db script.js
19
+
```
20
+
21
+
The example command makes k6 connect to a local InfluxDB instance and send the results from the test to a database named `myk6db`. If the database doesn't exist, k6 creates one automatically.
22
+
23
+
## Send k6 metrics to InfluxDB v2.0
24
+
9
25
Using the [InfluxDB extension](https://github.com/grafana/xk6-output-influxdb), you can store k6 metrics in [InfluxDB v2.0](https://docs.influxdata.com/influxdb/v2.0/) and analyze your performance results with Grafana or [other tools](https://docs.influxdata.com/influxdb/cloud-serverless/query-data/tools/).
10
26
11
-
## Build the k6 version
27
+
###Build the k6 version
12
28
13
29
To build a k6 binary with the extension, first, make sure you have [Go](https://golang.org/doc/install) and [Git](https://git-scm.com/) installed on your machine.
14
30
@@ -34,7 +50,7 @@ To learn more about how to build custom k6 versions, check out [xk6](https://git
34
50
35
51
{{< /admonition >}}
36
52
37
-
## Run the test
53
+
###Run the test
38
54
39
55
Check that the InfluxDB instance to store the k6 metrics is running.
40
56
@@ -54,7 +70,7 @@ k6 runs the test script and sends the [k6 metrics](https://grafana.com/docs/k6/<
54
70
55
71

56
72
57
-
## Options
73
+
###Options
58
74
59
75
Here is the full list of options that can be configured and passed to the extension:
60
76
@@ -71,10 +87,10 @@ Here is the full list of options that can be configured and passed to the extens
71
87
| K6_INFLUXDB_PRECISION | 1ns | The timestamp [Precision](https://docs.influxdata.com/influxdb/v2.7/reference/glossary/#precision). |
72
88
| K6_INFLUXDB_HTTP_PROXY || Sets an HTTP proxy for the InfluxDB output. |
73
89
74
-
## Grafana Dashboards
90
+
###Grafana Dashboards
75
91
76
92
You can use Grafana to query and visualize data from an InfluxDB instance. The instructions are available on [InfluxDB](https://docs.influxdata.com/influxdb/v2.7/tools/grafana/) and [Grafana](https://grafana.com/docs/grafana/latest/datasources/influxdb/).
77
93
78
94
You can also build a [custom Grafana dashboard](https://grafana.com/docs/k6/<K6_VERSION>/results-output/grafana-dashboards) to visualize the testing results in your own way.
79
95
80
-
For testing purposes, the [influxdb extension](https://github.com/grafana/xk6-output-influxdb) repository includes a [docker-compose setup](https://github.com/grafana/xk6-output-influxdb#docker-compose) with two basic dashboards.
96
+
For testing purposes, the [InfluxDB extension](https://github.com/grafana/xk6-output-influxdb) repository includes a [docker-compose setup](https://github.com/grafana/xk6-output-influxdb#docker-compose) with two basic dashboards.
0 commit comments