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

fix(metrics): kube-state-metrics pod metadata #3323

Merged
merged 1 commit into from Oct 16, 2023

Conversation

swiatekm-sumo
Copy link
Contributor

@swiatekm-sumo swiatekm-sumo commented Oct 13, 2023

We always drop container and pod attributes from kube state metrics if their value is the kube-state-metrics pod/container itself. This is usually wrong, as the attributes are added by the ServiceMonitor configuration to metrics which aren't about pods to begin with, like kube_deployment_status_replicas, for example.

However, this means we incorrectly drop these attributes from pod metrics about the kube-state-metrics pod itself, like kube_pod_status_phase.

This PR fixes this bug by checking for the uid attribute, which kube-state-metrics adds to all metrics about pods.

Checklist

  • Changelog updated or skip changelog label added
  • Integration tests added or modified for major features

@swiatekm-sumo swiatekm-sumo force-pushed the fix/metrics/kube-state-metrics-pod-metadata branch from abb815d to b5abe25 Compare October 14, 2023 16:50
@swiatekm-sumo swiatekm-sumo marked this pull request as ready for review October 14, 2023 17:04
@swiatekm-sumo swiatekm-sumo requested a review from a team as a code owner October 14, 2023 17:04
Copy link
Contributor

@sumo-drosiek sumo-drosiek left a comment

Choose a reason for hiding this comment

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

Nice!

@swiatekm-sumo swiatekm-sumo merged commit 5bcc43c into main Oct 16, 2023
34 checks passed
@swiatekm-sumo swiatekm-sumo deleted the fix/metrics/kube-state-metrics-pod-metadata branch October 16, 2023 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants