Skip to content

Web dashboard documentation updated to reflect the default enabled state #2002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions docs/sources/k6/next/results-output/web-dashboard/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,18 @@ weight: 200

# Web dashboard

k6 provides a built-in web dashboard that you can enable to visualize and monitor your tests results in real-time.
k6 provides a built-in web dashboard, enabled by default, to visualize and monitor your tests results in real-time.

![Web dashboard screenshot](/media/docs/k6-oss/web-dashboard-overview.png)

The dashboard provides a real-time overview of the performance observed by k6 while a test is running, and can help you identify potential reliability issues as they occur.

## How to use

The web dashboard is a built-in feature of k6. You can enable it by setting the `K6_WEB_DASHBOARD` environment variable to `true` when running your test script, for example:
The web dashboard is a built-in feature of k6 and is enabled by default.

```shell
K6_WEB_DASHBOARD=true k6 run script.js
```

```shell
K6_WEB_DASHBOARD=true ./k6 run script.js
./k6 run script.js

/\ Grafana /‾‾/
/\ / \ |\ __ / /
Expand All @@ -37,11 +33,17 @@ K6_WEB_DASHBOARD=true ./k6 run script.js

By default, the web dashboard is available on localhost port `5665`. You can change the host and port by using the [dashboard options](#dashboard-options).

You can disable the web dashboard by setting the `K6_NO_WEB_DASHBOARD` environment variable to `true` when running your test script, for example:

```shell
K6_NO_WEB_DASHBOARD=true k6 run script.js
```

{{< admonition type="note" >}}

The k6 process waits to exit as long as there's at least one open browser window for the dashboard extension.

In certain environments, such as a CI/CD pipeline, the k6 process has to exit after the test run completes. In that case, it's advisable to disable the HTTP port by setting it to `-1`.
In certain environments, such as a CI/CD pipeline, the k6 process has to exit after the test run completes. In that case, it's advisable to disable the web dashboard by setting `K6_NO_WEB_DASHBOARD` to `true`.

{{< /admonition >}}

Expand All @@ -62,7 +64,7 @@ To generate a report from the web dashboard, click **Report** on the dashboard's
To automatically generate a report from the command line once the test finishes running, use the `K6_WEB_DASHBOARD_EXPORT` option. For example:

```shell
K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=html-report.html k6 run script.js
K6_WEB_DASHBOARD_EXPORT=html-report.html k6 run script.js
```

{{< admonition type="note" >}}
Expand All @@ -77,7 +79,7 @@ The web dashboard can be configured using environment variables:

| Environment variable | Description | Default value |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| `K6_WEB_DASHBOARD` | Enable the web dashboard | `false` |
| `K6_NO_WEB_DASHBOARD` | Disable the web dashboard | `false` |
| `K6_WEB_DASHBOARD_HOST` | Host to bind the web dashboard to | `localhost` |
| `K6_WEB_DASHBOARD_PORT` | Port to bind the web dashboard to | `5665` |
| `K6_WEB_DASHBOARD_PERIOD` | Period in seconds to update the web dashboard | `10s` |
Expand Down