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 labels from self.SAMPLE_LABELS to container status metrics #7602

Conversation

jfmyers9
Copy link
Contributor

What does this PR do?

This change respects the pod_labels from label_joins when emitting the container status metrics.

This is similar to how SAMPLE_LABELS are processes for other resources in the check.

Motivation

Users rely on label_join to associate labels from the kube_pod_labels with other kube_pod_* metrics. For example, we rely on various labels to help us route alerts to the correct team for metrics within monitors.

Additional Notes

Nope.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@jfmyers9 jfmyers9 requested review from a team as code owners September 17, 2020 01:13
@ahmed-mez
Copy link
Contributor

Hi @jfmyers9, thanks for the contribution the changes look good. It would be great if you could add a unit test.
Thanks!

Users rely on label_join to associate labels from the `kube_pod_labels`
with other `kube_pod_*` metrics. We were previously dropping these
labels for these two metrics. This ensures that labels associated with
pods end up on the `kubernetes_state.container.status_report.*` metrics.

This is similar to how `SAMPLE_LABELS` are processes for other resources
in the check.
@jfmyers9 jfmyers9 force-pushed the jmyers/add-labels-to-container-status-metrics branch from eadfcec to a76f1a3 Compare October 5, 2020 16:55
@jfmyers9
Copy link
Contributor Author

jfmyers9 commented Oct 5, 2020

@ahmed-mez Added the metric to the existing test_join_custom_labels test. This felt more effective than breaking out an entirely new test, but let me know if you would prefer me to do so.

@jfmyers9
Copy link
Contributor Author

Any update on this pull request?

Our team is looking to utilize labels to improve monitoring of ImagePullBackoff and CrashLoopBackoff by associating these metrics with higher level objects such as applications / teams.

@ahmed-mez ahmed-mez merged commit 3364252 into DataDog:master Oct 12, 2020
@ahmed-mez
Copy link
Contributor

thanks @jfmyers9

@jfmyers9 jfmyers9 deleted the jmyers/add-labels-to-container-status-metrics branch October 12, 2020 16:10
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.

4 participants