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

Add environment variable expansion in external label values #8649

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

roidelapluie
Copy link
Member

Signed-off-by: Julien Pivotto roidelapluie@inuits.eu

@roidelapluie roidelapluie force-pushed the expand-external-labels branch 2 times, most recently from f45c0af to b2a2277 Compare March 25, 2021 21:30
Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

Just an idea for an additional test case.

c, err := LoadFile("testdata/external_labels.good.yml", false, log.NewNopLogger())
require.NoError(t, err)
require.Equal(t, labels.Label{Name: "bar", Value: "foo"}, c.GlobalConfig.ExternalLabels[0])
require.Equal(t, labels.Label{Name: "foo", Value: "${TEST}"}, c.GlobalConfig.ExternalLabels[1])
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps also add one with non-variable text, e.g. "foo${TEST}bar"

@roidelapluie
Copy link
Member Author

Note: This is pending a vote: https://groups.google.com/u/3/g/prometheus-developers/c/4JmD_glv0zg

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏽

Thanks

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
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