Skip to content

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

Merged

Conversation

DirectXMan12
Copy link
Contributor

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

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.
@cadvisorJenkinsBot
Copy link
Collaborator

Can one of the admins verify this patch?

@jszczepkowski
Copy link

@DirectXMan12
Great thanks for fixing this!

@rjnagal @vishh @jimmidyson
Can one of you take a look? This PR is badly needed to handle custom metrics in Kubernetes.

@rjnagal
Copy link
Contributor

rjnagal commented Dec 10, 2015

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

😭

@jszczepkowski
Copy link

@jimmidyson Can you please merge it?

@jimmidyson
Copy link
Collaborator

ok to test

@jimmidyson
Copy link
Collaborator

Jenkins PR status link is wrong, normal test flake when checking correct build. Merging.

Thanks @DirectXMan12

jimmidyson added a commit that referenced this pull request Dec 10, 2015
…-filtering

Fix Prometheus Metrics Filtering
@jimmidyson jimmidyson merged commit 5c34947 into google:master Dec 10, 2015
@DirectXMan12 DirectXMan12 deleted the bug/fix-prometheus-metrics-filtering branch December 10, 2015 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants