-
Notifications
You must be signed in to change notification settings - Fork 25
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
Enable K6 by default in agent deployments #722
Conversation
@@ -53,7 +53,7 @@ func (e FatalError) Error() string { return string(e) } | |||
var _ error = FatalError("") | |||
|
|||
const ( | |||
errCapabilityK6Missing = FatalError("k6 is required for scripted check support") | |||
errCapabilityK6Missing = FatalError("k6 is required for scripted check support - configure k6 or edit probe capabilities in the SM app") |
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.
errCapabilityK6Missing = FatalError("k6 is required for scripted check support - configure k6 or edit probe capabilities in the SM app") | |
errCapabilityK6Missing = FatalError("k6 is required for scripted check support - configure k6 or disable the probe's k6 capability in the SM app") |
Thoughts on this rewording? I can't find a good, succinct way to describe this.
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.
What comes to my mind is
errCapabilityK6Missing = FatalError("k6 is required for scripted check support - configure k6 or edit probe capabilities in the SM app") | |
errCapabilityK6Missing = FatalError("synthetic monitoring backend requested k6 to be enabled on this probe, but it is disabled by CLI arg") |
@@ -53,7 +53,7 @@ func (e FatalError) Error() string { return string(e) } | |||
var _ error = FatalError("") | |||
|
|||
const ( | |||
errCapabilityK6Missing = FatalError("k6 is required for scripted check support") | |||
errCapabilityK6Missing = FatalError("k6 is required for scripted check support - configure k6 or edit probe capabilities in the SM app") |
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.
What comes to my mind is
errCapabilityK6Missing = FatalError("k6 is required for scripted check support - configure k6 or edit probe capabilities in the SM app") | |
errCapabilityK6Missing = FatalError("synthetic monitoring backend requested k6 to be enabled on this probe, but it is disabled by CLI arg") |
if !config.DisableK6 { | ||
if err := features.Set(feature.K6); err != nil { | ||
return fmt.Errorf("cannot set k6 feature: %w", err) | ||
} | ||
} |
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.
It's not fully clear to me how the new flag (--disable-k6
) and the old one (--features=k6
) interact.
I think it makes sense having a dedicated K6 flag for disabling k6, but that makes me wonder if we should get rid of, or deprecate the feature flag.
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.
This change does get rid of the --features
flag on L105-106. I could "formally" deprecate it by detecting it and printing out a message.
How the new vs old flags interact
features
is a collection object which holds active features enabled on this probe. It used to have traceroute
and adhoc
when those were FFs, but now only k6
remains as functionality that can be disabled.
The old flag --features
was captured by flags.Var
, which implicitly called features.Set
on the arg value. features.Set
assumes a csv input and splits it to save each element.
Example: features.Set("traceroute,k6,adhoc")
-> map[string]struct{}{"traceroute": struct{}, "k6": struct{}, "adhoc": struct{}}
.
With this change, --features
is gone. We explicitly call features.Set("k6")
unless --disable-k6
is set, making k6
a default-enabled feature on the probe.
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.
Ah, you're definitely right, I did not see the removal of the --features
CLI flag 🙈
Looking good :)
* Chore(deps): Bump golang.org/x/net from 0.24.0 to 0.25.0 * Chore(deps): Bump the prometheus-go group across 1 directory with 2 updates * Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 * Update to grafana-build-tools v0.11.0 (#705) * Remove adhoc and traceroute feature flags. (#707) * Chore(deps): Bump github.com/KimMachineGun/automemlimit * checks/test: make timer big enough for context cancel to be picked up * Fix: Interpolate variables into MultiHTTP request bodies (#713) * Chore(deps): Bump github.com/prometheus/prometheus (#716) * Chore(deps): Bump github.com/rs/zerolog from 1.32.0 to 1.33.0 * --- updated-dependencies: - dependency-name: kernel.org/pub/linux/libs/security/libcap/cap dependency-type: direct:production update-type: version-update:semver-patch ... * MultiHttp script should decode the payload as a string and replace the variable placeholders with the values. The result should be assigned to the request body. (#717) * Build(deps): Bump golang.org/x/net from 0.25.0 to 0.26.0 * Enable K6 by default in agent deployments (#722) Signed-off-by: Anant Sharma <[email protected]>
* Chore(deps): Bump golang.org/x/net from 0.24.0 to 0.25.0 * Chore(deps): Bump the prometheus-go group across 1 directory with 2 updates * Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 * Update to grafana-build-tools v0.11.0 (#705) * Remove adhoc and traceroute feature flags. (#707) * Chore(deps): Bump github.com/KimMachineGun/automemlimit * checks/test: make timer big enough for context cancel to be picked up * Fix: Interpolate variables into MultiHTTP request bodies (#713) * Chore(deps): Bump github.com/prometheus/prometheus (#716) * Chore(deps): Bump github.com/rs/zerolog from 1.32.0 to 1.33.0 * --- updated-dependencies: - dependency-name: kernel.org/pub/linux/libs/security/libcap/cap dependency-type: direct:production update-type: version-update:semver-patch ... * MultiHttp script should decode the payload as a string and replace the variable placeholders with the values. The result should be assigned to the request body. (#717) * Build(deps): Bump golang.org/x/net from 0.25.0 to 0.26.0 * Enable K6 by default in agent deployments (#722) * Fix: deprecate --features and warn user (#726) * k6runner: use check context for http request (#715) Signed-off-by: Anant Sharma <[email protected]>
* Chore(deps): Bump golang.org/x/net from 0.24.0 to 0.25.0 * Chore(deps): Bump the prometheus-go group across 1 directory with 2 updates * Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 * Update to grafana-build-tools v0.11.0 (#705) * Remove adhoc and traceroute feature flags. (#707) * Chore(deps): Bump github.com/KimMachineGun/automemlimit * checks/test: make timer big enough for context cancel to be picked up * Fix: Interpolate variables into MultiHTTP request bodies (#713) * Chore(deps): Bump github.com/prometheus/prometheus (#716) * Chore(deps): Bump github.com/rs/zerolog from 1.32.0 to 1.33.0 * --- updated-dependencies: - dependency-name: kernel.org/pub/linux/libs/security/libcap/cap dependency-type: direct:production update-type: version-update:semver-patch ... * MultiHttp script should decode the payload as a string and replace the variable placeholders with the values. The result should be assigned to the request body. (#717) * Build(deps): Bump golang.org/x/net from 0.25.0 to 0.26.0 * Enable K6 by default in agent deployments (#722) * Fix: deprecate --features and warn user (#726) * k6runner: use check context for http request (#715) Signed-off-by: Anant Sharma <[email protected]>
Resolves #721
Decision (Slack)
Summary:
--features
from the cmd, adds an explicit--disable-k6
to disable the runner + k6 checks.Users upgrading from older probes (will) have k6 scripts disabled by default in the API if they weren't already running k6 checks. There are 2 cases for them:
k6
FF in args: no impact, this setup makes it default-enabled.k6
FF: this was the default. If they use the Docker image or have k6 on their PATH, then their upgraded agent would be able to set up ak6Runner
. Any previously-assigned MultiHTTP or scripted checks may start running. They will need to enable in the UI to assign k6 checks.For new probes, this change aligns the agent's default with the default assumption of the UI/Terraform (k6-enabled), so it should reduce issues with setup.
Also updated the error message when k6 is missing - feedback appreciated.