Cherry-pick #23730 to 7.x: Enrich k8s state service events & add selector meta #23806
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #23730 to 7.x branch. Original message:
What does this PR do?
state_service
metrics so as to enrich metrics with Service objects metadata.ServiceMetadataGenerator
to enrich Service related events and not the genericResourceMetadataGenerator
ServiceMetadataGenerator
so as to includeselector
information (if exist) for a Service object.Note that with this implementation
selector
's key:val maps are added similarly withlabels
likekubernetes.service.selectors.*
but we can add them differently if Metrics UI requires that, @sorantis just let me know what you think.Why is it important?
So as to properly enrich
state_service
events with Service metadata and includeselector
information in these metadata.Example:
This service will be enriched with
kubernetes.service.selectors.app: MyApp
which will give us to the option to correlate the service with all the pods that are selected/exposed by this service and are labeled withkubernetes.labels.app: MyApp
.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
kube_state_metrics
and specifically usingstate_service
metricset.Related issues