-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 labels_mapper option to kubernetes_state to allow tag renaming #651
Conversation
@xvello, thanks for your PR! By analyzing the history of the files in this pull request, we identified @gmmeyer, @olivielpeau and @truthbk to be potential reviewers. |
d44952e
to
33a0bbc
Compare
kubernetes_state/auto_conf.yaml
Outdated
# Tags are reported as set by kube-state-metrics. If you want to translate | ||
# them to other tags, you can use the labels_mapper dictionary | ||
# labels_mapper: | ||
# namespace: kube_namespace |
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 think the plan for agent 6 is to make init_config optional when it's not needed. And I think the kubernetes_state check only needs one instance, so init_config is unnecessary. If there's no particular reason to keep it here could you move this setting to the instance?
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.
was planning to do costly processing of the dict on import, but went without at the end. Moving to instance
kubernetes_state/conf.yaml.example
Outdated
@@ -1,4 +1,10 @@ | |||
init_config: | |||
# Tags are reported as set by kube-state-metrics. If you want to translate |
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.
ditto
11a5d68
to
4d7d97b
Compare
4d7d97b
to
1911403
Compare
1911403
to
69fac94
Compare
Rebase dismissed approval, checks green, force merging |
What does this PR do?
Allows user to set a
labels_mapper
option ininit_config
to rename tags from their original prometheus label name to better values. This is based on the existing mechanism inPrometheusCheck
, so changes are minimal.Motivation
User request to have metrics tagged with
kube_namespace
instead ofnamespace
for consistency with the kubernetes check.Versioning
[ ] Bumped the version check inmanifest.json
CHANGELOG.md