-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Enable web dashboard by default #4913
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
base: master
Are you sure you want to change the base?
Conversation
This change enables the built-in web dashboard by default to improve the out-of-the-box user experience. To support environments where a web server is not desired (e.g., CI/CD), the logic has been inverted from opt-in to opt-out. The dashboard can now be explicitly disabled. The `K6_WEB_DASHBOARD` environment variable and the `webDashboard` configuration option have been replaced. - To disable the dashboard, use the `K6_NO_WEB_DASHBOARD=true` environment variable. - To disable via JSON config, use the `noWebDashboard: true` option. BREAKING CHANGE: The `K6_WEB_DASHBOARD` and `webDashboard` settings are no longer supported. Scripts or environments relying on these to enable the dashboard will now have it enabled by default. To disable it, they must use the new `K6_NO_WEB_DASHBOARD` or `noWebDashboard` options.
{expRender: "web dashboard:"}, | ||
{env: "false", expRender: "web dashboard:"}, | ||
{env: "true", active: true, expRender: "web dashboard: http://127.0.0.1:"}, | ||
{active: true, expRender: "web dashboard: http://127.0.0.1:"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support environments where a web server is not desired (e.g., CI/CD),
the logic has been inverted from opt-in to opt-out. The dashboard can
now be explicitly disabled.
What will happen in CI/CD pipelines? Could this change break those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the CI/CD environment, where it is not disabled, the web dashboard is started on IP address 127.0.0.1 on port 5665. If multiple k6s are running on the same host (e.g. non-containerized environment), if there is a port conflict on the default port, the dashboard will only log it and not consider it a fatal error. This means there will be no breaking change in the CI/CD environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to not reverse the configuration attribute name, but just its default value. Otherwise, it would be a breaking change, and I don't see much value on doing so.
Wdyt?
I reversed the name of the configuration attribute so that it would be consistent with other attributes with similar roles (like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @szkiba 👋🏻
Thanks a lot for putting this together! I think it would make sense to find a way to provide the web-dashboard experience as a default, so it gets the visibility it deserves.
However, I have some concerns about the current approach that I think we should make sure to address before we move forward with it (keep in mind I don't have the full context in mind anymore):
Breaking change impact
I believe this can be considered a breaking change since we're modifying the options structure (removing an existing option) and flipping a previously opt-in behavior to default. While the user-experience improvement is valuable, introducing breaking changes in a minor release goes against our new versioning/maintenance policy, and could disrupt existing integrations and workflows. But I might be wrong or misinterpreting though, let me know.
Performance Considerations
I don't remember if we had thoroughly tested the performance impact of enabling the web dashboard by default across different scenarios. I think we might have though, and if such, could you point us to the results? Given that this will now run for every k6 execution, we should ensure that we have a good idea of the overhead it would introduce.
Ecosystem coordination
This change will most likely require some alignment and coordination across our internal ecosystem, as well as public one (k6-operator?), in order to explicitly disable the dashboard where appropriate. We should have a clear migration plan and timeline for these updates, before we proceed.
Solutions
I'd like to offer alternative solutions:
- Non-breaking transition: Is there a way we could make these changes without having to drop an existing option, and/or change the default behavior of k6 for users within this major cycle: improve the visibility of this feature without having to switch to default enable in the meantime: better docs, cli hints, etc?
- Plan for v2: Plan this as part of our next major release where breaking changes are expected.
- Gradual rollout: Perhaps we could also look into way to "decide" whether the dashboard can be enabled by default, or at least proposed to the user based on what kind of test we run, and in what environment.
To be clear, I'm definitely not against the end goal, but I want to make sure we're thoughtful about the implementation path. What do you folks think?
Hi @oleiade Thank you for the thorough review and for outlining your concerns. I appreciate you taking the time to provide this detailed feedback. Regarding the breaking change impact, I completely agree with the principle of avoiding breaking changes in minor releases. To help me better understand the full scope, could you elaborate on some of the use cases you believe would be disrupted? I'm trying to picture if this would affect CI/CD pipelines that parse logs, specific integrations, or other workflows I might not be aware of. Your perspective here would be very helpful. On the topic of performance considerations, I agree that having solid performance data is essential before moving forward. I wanted to share some context from my previous attempt to run these tests about a year and a half ago, where I ran into some difficulties with the performance test suite itself. It seemed at the time that it wasn't in a state where I could easily get a clean measurement. With that in mind, has the state of the performance test suite changed recently? If it's now more accessible, I would be happy to give it another shot. If the suite itself still requires maintenance, I agree that this is a blocker. In that case, I'd appreciate the core team's guidance on whether they have the capacity to investigate the performance impact, or if there are resources I could use to help get the tests running. Thanks again for the crucial feedback. I'm keen to find the right path forward for this. |
@inancgumus Actually, xk6-dashboard v0.7.9 fixes the conflict mentioned in #4826 as a side effect. v0.7.9 has already been merged into master. So I think #4826 can be closed. Honestly, I originally thought it wasn't worth fixing because the output name "web-dashboard" is unsupported and undocumented. The fact that the user found out that the built-in dashboard is an output name called "web-dashboard" doesn't justify fixing the conflict. However, the fix is done, it might be worth merging (I thought the fix was simple and elegant). |
What
This PR changes the behavior of the built-in web dashboard to be enabled by default.
k6 run
.K6_WEB_DASHBOARD
environment variable andwebDashboard
JSON property have been removed.K6_NO_WEB_DASHBOARD=true
noWebDashboard: true
NOTE:
The
webDashboard
property andK6_WEB_DASHBOARD
environment variable are no longer supported. Users who explicitly set these totrue
will now have the dashboard enabled by default and should remove the old settings. To disable the dashboard, they must migrate to the newnoWebDashboard
orK6_NO_WEB_DASHBOARD
options.Why
The primary motivation is to improve the out-of-the-box user experience. By enabling the dashboard by default, we provide immediate, real-time visual feedback for test runs without requiring manual configuration. This makes a powerful feature more discoverable and provides instant value to both new and existing users. The opt-out mechanism ensures that users who run k6 in environments where a web server is not desired (e.g., CI/CD) retain full control.
Closes #4903