Skip to content
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

feat(coderd): export metric indicating each experiment's status #12657

Merged
merged 5 commits into from
Mar 19, 2024

Conversation

dannykopping
Copy link
Contributor

Relates to #12070

Exposes a metric indicating which experiments are active/inactive.
I chose to expose the experiments that are not active as well because this will allow operators to get the same view in metrics as what we expose in the frontend.

Signed-off-by: Danny Kopping <danny@coder.com>
@dannykopping dannykopping changed the title feat(prometheusmetrics): export metric indicating each experiment's status feat(coderd): export metric indicating each experiment's status Mar 19, 2024
coderd/prometheusmetrics/prometheusmetrics.go Outdated Show resolved Hide resolved
coderd/prometheusmetrics/prometheusmetrics_test.go Outdated Show resolved Hide resolved
coderd/prometheusmetrics/prometheusmetrics_test.go Outdated Show resolved Hide resolved
coderd/prometheusmetrics/prometheusmetrics_test.go Outdated Show resolved Hide resolved
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to raise the linter limit a bit to avoid the gocognit issue. This is best adressed in a follow up PR but isn’t critical.

Except for a few nits looks good otherwise.

coderd/prometheusmetrics/prometheusmetrics.go Outdated Show resolved Hide resolved
coderd/prometheusmetrics/prometheusmetrics.go Show resolved Hide resolved
coderd/prometheusmetrics/prometheusmetrics.go Show resolved Hide resolved
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Danny Kopping <danny@coder.com>
var active codersdk.Experiments
for _, exp := range options.DeploymentValues.Experiments.Value() {
active = append(active, codersdk.Experiment(exp))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but optionally to keep it cleaner, you could move this to codersdk, something like codersdk.ExperimentsFromString(Value()...).

@dannykopping dannykopping merged commit 9cfd5ba into coder:main Mar 19, 2024
23 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2024
@dannykopping dannykopping deleted the dk/experiments-prom branch March 19, 2024 12:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants