Search code examples
prometheuscadvisor

Prometheus & cadvisor / Collect only some metrics with cadvisor


I'm using cadvisor to collect metrics on my dockers (running on core os). using prometheus as the monitoring server.

I see that prometheus is collecting a lot of metrics which I don't need. I'm trying to find a way to collect only some of the metrics.

didn't find anything in the documentation that allows me to do that.


Solution

  • It's best to drop such things at the exporter, but I don't believe cadvisor has support for that. You can use metric_relabel_configs:

       metric_relabel_configs:
       - source_labels: [ __name__ ]
         regex: 'my_too_large_metric'
         action: drop
    

    Prometheus is quite efficient, so metrics should only be dropped if they're causing you performance/resource issues.