Skip to content

Commit 27f8f2c

Browse files
Experimental opentelemetry output (#1674)
* experimental opentelemetry output --------- Co-authored-by: Joan López de la Franca Beltran <[email protected]>
1 parent 1529fa3 commit 27f8f2c

File tree

1 file changed

+6
-34
lines changed

1 file changed

+6
-34
lines changed

docs/sources/next/results-output/real-time/opentelemetry.md

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
22
title: 'OpenTelemetry'
3-
description: 'Use the OpenTelemetry output extension to send test results in OTEL metrics format.'
3+
description: 'Use the OpenTelemetry experimental output to send test results in OTEL metrics format.'
44
weight: 00
55
---
66

77
# OpenTelemetry
88

9-
Grafana k6 can push test run metrics in the [OpenTelemetry (OTEL) metrics format](https://opentelemetry.io/docs/specs/otel/metrics/) to an OTEL metrics collector or a metrics backend that supports the OTEL metrics format by using the [xk6-output-opentelemetry extension](https://github.com/grafana/xk6-output-opentelemetry/).
9+
Grafana k6 can push test run metrics in the [OpenTelemetry (OTEL) metrics format](https://opentelemetry.io/docs/specs/otel/metrics/) to an OTEL metrics collector or a metrics backend that supports the OTEL metrics format by using the experimental OpenTelemetry output `--out experimental-opentelemetry`.
1010

11-
{{< admonition type="note" >}}
11+
Note that the `experimental-opentelemetry` became a part of k6 only with k6 v0.53.0, so prior that version you should use the [xk6-output-opentelemetry extension](https://github.com/grafana/xk6-output-opentelemetry/).
1212

13-
This is an extension, and we're looking for feedback and contributions and aiming to graduate it as an experimental output within Grafana k6 in a future release. Feel free to [open an issue](https://github.com/grafana/xk6-output-opentelemetry/issues) if you have any feedback or suggestions.
14-
15-
{{< /admonition >}}
13+
For any feedback, bugs or suggestions feel free to [open an issue](https://github.com/grafana/xk6-output-opentelemetry/issues) directly in the output repository. Contributions are also welcome!
1614

1715
## Metrics mapping
1816

@@ -25,40 +23,14 @@ k6 converts all [k6 metric types](https://grafana.com/docs/k6/<K6_VERSION>/using
2523
| Rate | Split into two `Int64Counter` counters named `metric_name.occurred` and `metric_name.total`. `metric_name.occurred` counts only the number of non-zero occurrences, and `metric_name.total` registers the total number of positive and negative occurrences. This might change in the future, refer to [xk6-output-opentelemetry#12](https://github.com/grafana/xk6-output-opentelemetry/issues/12) for more details. |
2624
| Trend | `Float64Histogram` |
2725

28-
## Build the k6 version
29-
30-
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.
31-
32-
Then, open your terminal and run the following commands:
33-
34-
```bash
35-
# Install xk6
36-
go install go.k6.io/xk6/cmd/xk6@latest
37-
38-
# Build the k6 binary
39-
xk6 build --with github.com/grafana/xk6-output-opentelemetry
40-
41-
... [INFO] Build environment ready
42-
... [INFO] Building k6
43-
... [INFO] Build complete: ./k6
44-
```
45-
46-
xk6 will create the new k6 binary in the local folder.
47-
48-
{{% admonition type="note" %}}
49-
50-
To learn more about how to build custom k6 versions, refer to [xk6](https://github.com/grafana/xk6).
51-
52-
{{% /admonition %}}
53-
5426
## Run the k6 test
5527

56-
Using the k6 binary you built in the previous step, you can use the `--out xk6-opentelemetry` option when running your tests to use this extension:
28+
You can use the `--out experimental-opentelemetry` option when running your tests to use this extension:
5729

5830
{{< code >}}
5931

6032
```bash
61-
$ ./k6 run --out xk6-opentelemetry script.js
33+
$ K6_OTEL_GRPC_EXPORTER_INSECURE=true K6_OTEL_METRIC_PREFIX=k6_ k6 run --tag test-id=123 -o experimental-opentelemetry examples/script.js
6234
```
6335

6436
{{< /code >}}

0 commit comments

Comments
 (0)