Description
Feature Request: Enable Built-in Web Dashboard by Default
Is your feature request related to a problem? Please describe.
Currently, the Grafana k6 built-in web dashboard is a powerful feature for real-time test visualization, but it is disabled by default. To activate it, users must set the K6_WEB_DASHBOARD=true
environment variable. This requirement adds an extra step to the initial user experience and may not be immediately discoverable for newcomers. The benefits of real-time monitoring are significant, and making this feature readily available would enhance the out-of-the-box experience with k6.
Describe the solution you'd like
The k6 web dashboard should be enabled by default when running k6 run
. This would automatically start the web server and provide users with a link to the dashboard in the console output upon test execution.
To maintain flexibility and accommodate environments where a web server is not desired (e.g., certain CI/CD pipelines), a clear and simple opt-out mechanism should be provided. A suggested environment variable for this is K6_NO_WEB_DASHBOARD=true
.
The existing K6_WEB_DASHBOARD_OPEN=true
could still be used to automatically open the dashboard in the browser, but the default behavior would be to simply start the server and display the URL.
Describe alternatives you've considered
The current method of using K6_WEB_DASHBOARD=true
is a viable alternative but is not as user-friendly as having the feature enabled by default. Another alternative would be to prompt the user to enable the dashboard on the first run, but this could add unnecessary complexity to the command-line interface.
Additional context
Enabling the web dashboard by default would align with a more "batteries-included" approach, offering a richer initial experience. Many developers and testers, especially those new to k6, would benefit from seeing their test results visualized without having to consult the documentation to enable this feature. The console output could look something like this:
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
execution: local
script: test.js
output: web dashboard available at http://localhost:5665
scenarios: (100.00%) 1 scenario, 1 max VUs, 10s max duration (executing)
* default: 1 looping VUs for 10s (gracefulStop: 30s)
running (00m01s/10s), 1/1 VUs, 1 complete and 0 interrupted iterations
...
This change would make a powerful k6 feature more accessible and improve the overall developer experience. ✨