Skip to content

Commit

Permalink
Add traces output option docs (#1433)
Browse files Browse the repository at this point in the history
Adds documentation about the traces output configuration option for k6
run command, including specific documentation for the currently
supported outputs for it (only OTEL by now).
  • Loading branch information
ka3de authored Dec 4, 2023
1 parent 8c788a4 commit bb24a4e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/sources/next/using-k6/k6-options/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Each option has its own detailed reference in a separate section.
| [TLS auth](#tls-auth) | A list of TLS client certificate configuration objects |
| [TLS cipher suites](#tls-cipher-suites) | A list of cipher suites allowed to be used by in SSL/TLS interactions with a server |
| [TLS version](#tls-version) | String or object representing the only SSL/TLS version allowed |
| [Traces output](#traces-output) | Configuration about where traces from k6 should be sent |
| [User agent](#user-agent) | A string specifying the User-Agent header when sending HTTP requests |
| [Verbose](#verbose) | A boolean specifying whether verbose logging is enabled |
| [VUs](#vus) | A number specifying the number of VUs to run concurrently |
Expand Down Expand Up @@ -1433,6 +1434,48 @@ export const options = {

{{< /code >}}

## Traces output

This option specifies where to send traces to. Available in the `k6 run` command.

| Env | CLI | Code / Config file | Default |
| ------------------ | ----------------- | ------------------ | ------- |
| `K6_TRACES_OUTPUT` | `--traces-output` | N/A | `none` |

{{< code >}}

```bash
$ k6 run --traces-output=otel script.js
```

{{< /code >}}

Possible values are:

- none - disable
- otel - send traces to an OTEL compatible backend

### OTEL

Use the `traces-output` option to configure [Open Telemetry](https://opentelemetry.io/) compatible output as follows.

{{< code >}}

```bash
$ k6 run --traces-output=otel=http://127.0.0.1:4318,proto=http,header.AdditionalHeader=example script.js
```

{{< /code >}}

Where none of the options are required.
The possible keys with their meanings and default values:

| key | description | default value |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `nothing` | the endpoint to which send traces to | `http://127.0.0.1:4317` |
| proto | the protocol to use when connecting with the traces backend | `grpc` |
| header.`headerName` | adds an additional HTTP header with the provided header name and value to each HTTP request made to the traces backend | N/A |

## Upload Only

A boolean specifying whether the test should just be uploaded to the cloud, but not run it. Available in `k6 cloud` command.
Expand Down

0 comments on commit bb24a4e

Please sign in to comment.