---
title: k6
description: Analyze and visualize k6 performance testing metrics in DataDog
breadcrumbs: Docs > Integrations > k6
---

# k6
Supported OS Integration version1.0.0
## Overview{% #overview %}

[k6](https://k6.io/open-source) is an open-source load testing tool that helps you catch performance issues and regressions earlier.

With the k6 integration, you can track performance metrics of k6 tests to:

- Correlate application performance with load testing metrics.
- Create alerts based on performance testing metrics.
- Analyze and visualize k6 metrics using the k6 Datadog Dashboard or [Metrics Explorer](https://docs.datadoghq.com/metrics/explorer/).



## Setup{% #setup %}

For the detailed instructions, follow the [k6 documentation](https://grafana.com/docs/k6/latest/results-output/real-time/datadog/).

### Installation{% #installation %}

1. In Datadog, navigate to Integrations > [API](https://app.datadoghq.com/organization-settings/api-keys) to copy your API key.

1. Run the Datadog Agent:

To get k6 metrics into Datadog, k6 sends metrics through the Datadog Agent, which collects, aggregates, and forwards the metrics to the Datadog platform.

Run the Datadog Agent service as a Docker container with this command:

   ```shell
   DOCKER_CONTENT_TRUST=1 \
   docker run -d \
       --name datadog \
       -v /var/run/docker.sock:/var/run/docker.sock:ro \
       -v /proc/:/host/proc/:ro \
       -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
       -e DD_SITE="datadoghq.com" \
       -e DD_API_KEY=<YOUR_DATADOG_API_KEY> \
       -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=1 \
       -p 8125:8125/udp \
       datadog/agent:latest
   ```

**Note**: Replace `<YOUR_DATADOG_API_KEY>` with your [API](https://app.datadoghq.com/organization-settings/api-keys) key. If your account is registered with Datadog EU, change the value of `DD_SITE` to `datadoghq.eu`.

1. Run the k6 test and output the results to Datadog.

Once the Datadog Agent service is running, run the k6 test and send the metrics to the Agent with:

   ```shell
   K6_STATSD_ENABLE_TAGS=true k6 run --out output-statsd script.js
   ```

1. Visualize the k6 metrics in Datadog.

While running the test, k6 sends metrics periodically to DataDog. By default, these metrics have `k6.` as the name prefix.

You can visualize k6 metrics in realtime with the [metrics explorer](https://docs.datadoghq.com/metrics/explorer/), [monitors](https://docs.datadoghq.com/monitors/), or [custom dashboards](https://docs.datadoghq.com/dashboards/).



Additionally, the first time Datadog detects the `k6.http_reqs` metric, the k6 integration tile is installed automatically, and the default k6 dashboard is added to your [dashboard list](https://docs.datadoghq.com/dashboards/list).

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **k6.data\_sent**(count)                               | The amount of data sent*Shown as byte*                                                     |
| **k6.data\_received**(count)                           | The amount of received data*Shown as byte*                                                 |
| **k6.http\_req\_blocked.avg**(gauge)                   | Average time spent blocked before initiating the request*Shown as millisecond*             |
| **k6.http\_req\_blocked.max**(gauge)                   | Max time spent blocked before initiating the request*Shown as millisecond*                 |
| **k6.http\_req\_blocked.median**(gauge)                | Median time spent blocked before initiating the request*Shown as millisecond*              |
| **k6.http\_req\_blocked.95percentile**(gauge)          | 95th time spent blocked before initiating the request*Shown as millisecond*                |
| **k6.http\_req\_blocked.99percentile**(gauge)          | 99th time spent blocked before initiating the request*Shown as millisecond*                |
| **k6.http\_req\_blocked.count**(rate)                  | The number of http_req_blocked values submitted during the interval*Shown as unit*         |
| **k6.http\_req\_connecting.avg**(gauge)                | Average time spent establishing TCP connection*Shown as millisecond*                       |
| **k6.http\_req\_connecting.max**(gauge)                | Max time spent establishing TCP connection*Shown as millisecond*                           |
| **k6.http\_req\_connecting.median**(gauge)             | Median time spent establishing TCP connection*Shown as millisecond*                        |
| **k6.http\_req\_connecting.95percentile**(gauge)       | 95th time spent blocked before initiating the request*Shown as millisecond*                |
| **k6.http\_req\_connecting.99percentile**(gauge)       | 99th time spent blocked before initiating the request*Shown as millisecond*                |
| **k6.http\_req\_connecting.count**(rate)               | The number of http_req_connecting values submitted during the interval*Shown as unit*      |
| **k6.http\_req\_duration.avg**(gauge)                  | Average request time*Shown as millisecond*                                                 |
| **k6.http\_req\_duration.max**(gauge)                  | Max request time*Shown as millisecond*                                                     |
| **k6.http\_req\_duration.median**(gauge)               | Median request time*Shown as millisecond*                                                  |
| **k6.http\_req\_duration.95percentile**(gauge)         | 95th request time*Shown as millisecond*                                                    |
| **k6.http\_req\_duration.99percentile**(gauge)         | 99th request time*Shown as millisecond*                                                    |
| **k6.http\_req\_duration.count**(rate)                 | The number of http_req_duration values submitted during the interval*Shown as unit*        |
| **k6.http\_reqs**(count)                               | Total number of HTTP requests*Shown as request*                                            |
| **k6.http\_req\_receiving.avg**(gauge)                 | Average time spent receiving response data*Shown as millisecond*                           |
| **k6.http\_req\_receiving.max**(gauge)                 | Max time spent receiving response data*Shown as millisecond*                               |
| **k6.http\_req\_receiving.median**(gauge)              | Median time spent receiving response data*Shown as millisecond*                            |
| **k6.http\_req\_receiving.95percentile**(gauge)        | 95th time spent receiving response data*Shown as millisecond*                              |
| **k6.http\_req\_receiving.99percentile**(gauge)        | 99th time spent receiving response data*Shown as millisecond*                              |
| **k6.http\_req\_receiving.count**(rate)                | The number of http_req_receiving values submitted during the interval*Shown as unit*       |
| **k6.http\_req\_sending.avg**(gauge)                   | Average time spent sending data*Shown as millisecond*                                      |
| **k6.http\_req\_sending.max**(gauge)                   | Max time spent sending data*Shown as millisecond*                                          |
| **k6.http\_req\_sending.median**(gauge)                | Median time spent sending data*Shown as millisecond*                                       |
| **k6.http\_req\_sending.95percentile**(gauge)          | 95th time spent sending data*Shown as millisecond*                                         |
| **k6.http\_req\_sending.99percentile**(gauge)          | 99th time spent sending data*Shown as millisecond*                                         |
| **k6.http\_req\_sending.count**(rate)                  | The number of http_req_sending values submitted during the interval*Shown as unit*         |
| **k6.http\_req\_tls\_handshaking.avg**(gauge)          | Average time spent handshaking TLS session*Shown as millisecond*                           |
| **k6.http\_req\_tls\_handshaking.max**(gauge)          | Max time spent handshaking TLS session*Shown as millisecond*                               |
| **k6.http\_req\_tls\_handshaking.median**(gauge)       | Median time spent handshaking TLS session*Shown as millisecond*                            |
| **k6.http\_req\_tls\_handshaking.95percentile**(gauge) | 95th time spent handshaking TLS session*Shown as millisecond*                              |
| **k6.http\_req\_tls\_handshaking.99percentile**(gauge) | 99th time spent handshaking TLS session*Shown as millisecond*                              |
| **k6.http\_req\_tls\_handshaking.count**(rate)         | The number of http_req_tls_handshaking values submitted during the interval*Shown as unit* |
| **k6.http\_req\_waiting.avg**(gauge)                   | Average time spent waiting for response (TTFB)*Shown as millisecond*                       |
| **k6.http\_req\_waiting.max**(gauge)                   | Max time spent waiting for response (TTFB)*Shown as millisecond*                           |
| **k6.http\_req\_waiting.median**(gauge)                | Median time spent waiting for response (TTFB)*Shown as millisecond*                        |
| **k6.http\_req\_waiting.95percentile**(gauge)          | 95th time spent waiting for response (TTFB)*Shown as millisecond*                          |
| **k6.http\_req\_waiting.99percentile**(gauge)          | 99th time spent waiting for response (TTFB)*Shown as millisecond*                          |
| **k6.http\_req\_waiting.count**(rate)                  | The number of http_req_waiting values submitted during the interval*Shown as unit*         |
| **k6.iteration\_duration.avg**(gauge)                  | Average time spent for a VU iteration*Shown as millisecond*                                |
| **k6.iteration\_duration.max**(gauge)                  | Max time spent for a VU iteration*Shown as millisecond*                                    |
| **k6.iteration\_duration.median**(gauge)               | Median time spent for a VU iteration*Shown as millisecond*                                 |
| **k6.iteration\_duration.95percentile**(gauge)         | 95th time spent for a VU iteration*Shown as millisecond*                                   |
| **k6.iteration\_duration.99percentile**(gauge)         | 99th time spent for a VU iteration*Shown as millisecond*                                   |
| **k6.iteration\_duration.count**(rate)                 | The number of iteration_duration values submitted during the interval*Shown as unit*       |
| **k6.iterations**(count)                               | Aggregated number of VU iterations*Shown as unit*                                          |
| **k6.vus**(gauge)                                      | Current number of active virtual users*Shown as user*                                      |
| **k6.vus\_max**(gauge)                                 | Max possible number of virtual users*Shown as user*                                        |

### Service Checks{% #service-checks %}

The k6 integration does not include any service checks.

### Events{% #events %}

The k6 integration does not include any events.

## Troubleshooting{% #troubleshooting %}

Need help? Read the [k6 Datadog documentation](https://grafana.com/docs/k6/latest/results-output/real-time/datadog/) or contact [k6 support](https://community.k6.io/).
