Skip to content

Conversation

@am97
Copy link
Contributor

@am97 am97 commented Jan 20, 2025

Currently, passing multiple --enable-feature doesn't work:

$ docker run --rm -it --entrypoint sh prom/alertmanager:v0.28.0
/alertmanager $ alertmanager --config.file=/etc/alertmanager/alertmanager.yml --enable-feature=auto-gomemlimit --enable-feature=auto-gomaxprocs
alertmanager: error: flag 'enable-feature' cannot be repeated, try --help

The intended syntax seems to be a single --enable-feature flag, with a comma-separated list of features as value. This is what is tested here:

{
name: "with both, valid and invalid feature flags",
featureFlags: strings.Join([]string{FeatureReceiverNameInMetrics, "somethingbad"}, ","),
err: errors.New("Unknown option 'somethingbad' for --enable-feature"),
},

Signed-off-by: Andrés Maldonado <maldonado@codelutin.com>
Copy link
Collaborator

@grobinson-grafana grobinson-grafana left a comment

Choose a reason for hiding this comment

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

I would prefer we put what it does first and the expected format second. Otherwise LGTM!

Co-authored-by: George Robinson <george.robinson@grafana.com>
Signed-off-by: am97 <amaldona@tutanota.com>
@gotjosh gotjosh merged commit cdd134a into prometheus:main Mar 6, 2025
11 checks passed
This was referenced Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants