-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix Prometheus Metrics Filtering #1012
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 Prometheus Metrics Filtering #1012
Conversation
Previously, the Prometheus collector ignored the `MetricsConfig` field of the custom metrics specification, simply storing all exposed metrics. Now, if the `MetricsConfig` field contains any metric names, only those metrics will be stored and exposed. Fixes google#1005
The documentation for custom metrics contained an error in the Prometheus metrics example JSON, and was also somewhat unclear as to how the labels worked.
Can one of the admins verify this patch? |
@DirectXMan12 @rjnagal @vishh @jimmidyson |
Thanks @DirectXMan12 this has been sitting in my queue for a while LGTM |
@@ -88,6 +87,9 @@ Dockerfile (or runtime): | |||
|
|||
cAdvisor will then reach into the container image at runtime, process the config, and start collecting and exposing application metrics. | |||
|
|||
Note that cAdvisor specifically looks at the container labels to extract this information. In Docker 1.8, containers don't inherit labels | |||
from their images, and thus you must specify the label at runtime. |
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.
😭
@jimmidyson Can you please merge it? |
ok to test |
Jenkins PR status link is wrong, normal test flake when checking correct build. Merging. Thanks @DirectXMan12 |
…-filtering Fix Prometheus Metrics Filtering
Previously, the Prometheus collector ignored the list of metrics specified in the custom metrics config, and just collected and stored all metrics. This makes the Prometheus collector skip metrics that aren't listed.
Also included is a tweak to the custom metrics documentation.
Fixes #1005