-
Notifications
You must be signed in to change notification settings - Fork 40.5k
cAdvisor should export pod labels for container metrics #32326
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
Comments
At SoundCloud we work around the problem by using an extra exporter which exports all pod labels in a separate metric and we then join these together in our queries. This is similar to the approach described in @brian-brazil's blog post about machine role labels. Exporting a lot labels per metric makes it more difficult to work with them. So this might even be the more desirable approach. @fabxc @kubernetes/sig-instrumentation We should discuss this need in our next meeting. |
http://www.robustperception.io/exposing-the-software-version-to-prometheus/ is a slightly more relevant version of that blog post. |
@grobie @brian-brazil Although we're using Prometheus' exposition format, we do have to make sure that any decisions we make around labelling don't restrict/negatively affect other consumers. If this was a Prometheus only decision then I would 100% agree with you though. |
I think its a reasonable step of normalization to constrain labels to the minimum identity-giving set in the exposition. The consumer is free to denormalize again for its own purposes – in Prometheus this happens to be at query time. But other systems can easily do so on write. Of course it's saner if it's happening in the same metric set. But #18770 aims at just that. |
@grobie Any chance of open sourcing that? |
My idea was that kubelet should expose an extension API that let's On Wed, Sep 14, 2016 at 1:27 PM, Steffen Hanikel notifications@github.com
|
@hanikesn @grobie FYI just added support for exporting a pod-label-metric for kube-api-exporter: tomwilkie/kube-api-exporter#9 (edited) I also wrote a blog post on how to do the join in Prometheus - https://www.weave.works/aggregating-pod-resource-cpu-memory-usage-arbitrary-labels-prometheus/ |
is any chance that this will be implemented in the next release ? Thanks a lot! |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle rotten |
cc @dchen1107 |
This would be very useful. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@hanikesn any news on this? |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Note that prometheus/client_golang doesn't require consistent label dimensions anymore, which might come in handy here. See prometheus/client_golang#417 . Also, you can now have unchecked Collectors in a formally correct way. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@brancz Still planned? |
@Nowaker the metrics overhaul has been moved to 1.14 but the pull request is already out to make this change! |
Yay! Thanks a ton @brancz. |
@brancz got a reference for the 1.14 PR? |
The PR is here: #69099 |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
#69099 was merged, so this is landing in 1.14 🎉 |
@alvaroaleman: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I see. I think that’s metadata that should be joined onto the metric at query time (this data itself is already available in kube state metrics). More importantly labels on a pod can change over a pod’s lifetime which if we added pod labels to these metrics they would be marked stale and produce a new time-series which wouldn’t reflect the reality. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I partially solved my case: Needs to have 'deployment' or 'app' label as a filter for pods names But how nice would it be, if cAdvisor could forward an 'app' label along with metrics... |
@sirkubax: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Any updates on this? |
/reopen |
@woodliu: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hot to ? |
Currently it's cAdvisor doesn't export pod labels for container level metrics. This would be desirable to be able to aggregate container level metrics by application.
As Kubernetes doesn't set pod labels on Docker containers (#25301) cAdvisor can't export those labels to it's
/metrics
endpoint which makes metric aggregation by pod labels impossible. Kubernetes doesn't set these labels, because currently it's not possible to dynamically set Docker Container Labels (moby/moby#21721). It's also not clear when this situation will change.I propose a implementing a workaround, so that cAdvisor can directly get the labels from the kublet and export them accordingly.
The text was updated successfully, but these errors were encountered: