-
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 pod:
tags to kubernetes_state status reason metrics
#1884
Add pod:
tags to kubernetes_state status reason metrics
#1884
Conversation
@@ -383,6 +383,8 @@ def kube_pod_container_status_waiting_reason(self, message, **kwargs): | |||
tags.append(self._format_tag("kube_container_name", label.value)) | |||
elif label.name == "namespace": | |||
tags.append(self._format_tag(label.name, label.value)) | |||
elif label.name == "pod": |
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 guess kube_pod_container_status_waiting_reason()
and kube_pod_container_status_terminated_reason()
could use some refactoring to avoid so much duplicated code between them as only the metric name and whitelist differ from one to the other.
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.
yup, makes sense! Looks better now
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.
LGTM, if we could add some doc arround how the whitelist are important to not explose the cardinality of the metric for future reference, that would be great
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.
LGTM @antoinepouille
d59322f
to
8618f60
Compare
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.
Approved. Let's make sure CI pass before to merge tho.
Thanks! Can you confirm which datadog-agent release will get this new feature? Note: the actual metrics are named |
* Adding pod tags to kube_pod_container_status_waiting_reason and kube_pod_container_status_terminated_reason metrics * Refactoring metric logic for the two state reason metrics * fix line lengths * Adding comment regarding reason whitelist for cardinality
What does this PR do?
Adding pod tags to
kube_pod_container_status_waiting_reason
andkube_pod_container_status_terminated_reason
metricsMotivation
Github issue #1418
Review checklist
no-changelog
label attached