# Filter specific metrics before scraping

**URL:** <https://discuss.prometheus.io/t/filter-specific-metrics-before-scraping/845>\
**Category:** node\_exporter\
**Created:** [March 15, 2022, 6:22pm UTC](https://discuss.prometheus.io/t/filter-specific-metrics-before-scraping/845 "2022-03-15T18:22:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![technoturing](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@technoturing](https://discuss.prometheus.io/u/technoturing)\
**Post date:** [March 15, 2022, 6:22pm UTC](https://discuss.prometheus.io/t/filter-specific-metrics-before-scraping/845/1 "2022-03-15T18:22:39Z")

</div>

Hello,

I have a node\_exporter pod in Kubernetes, and I was curious about how I can filter/( drop or keep) specific metrics before scraping them. For example in CPU collector, what should I do to filter node\_cpu\_core\_throttles\_total or with regex node\_cpu\_core\* metric/s?  
I know there is a relable\_configs but \_\_ _name_ \_\_ source label does not work to filter specific metrics I am looking for.  
And metric\_relabel\_configs is not useful for my case, because it filters the metrics after scraping.

---

<div class="post-metadata">

**Author:** ![stuart](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/stuart/32/18_2.png) [@stuart](https://discuss.prometheus.io/u/stuart)\
**Post date:** [March 16, 2022, 10:06am UTC](https://discuss.prometheus.io/t/filter-specific-metrics-before-scraping/845/2 "2022-03-16T10:06:32Z")

</div>

The only way to drop things without having already scraped them (ie using metric\_relabel) is for the metric not to have been exposed for scraping in the first place. This is totally down to the exporter and what (if any) configuration options it gives.

If there are no options in the exporter then the metric will be scraped, but you could then subsequently drop it. Is there a reason why you don’t want to ingest that metric?

---

<div class="post-metadata">

**Author:** ![technoturing](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@technoturing](https://discuss.prometheus.io/u/technoturing)\
**Post date:** [March 16, 2022, 11:43am UTC](https://discuss.prometheus.io/t/filter-specific-metrics-before-scraping/845/3 "2022-03-16T11:43:13Z")

</div>

Thank you very much for your answer. So I am trying to reduce the network bandwidth that is being used by monitoring metrics such as node\_exporter.

---

<div class="post-metadata">

**Author:** ![stuart](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/stuart/32/18_2.png) [@stuart](https://discuss.prometheus.io/u/stuart)\
**Post date:** [March 16, 2022, 1:01pm UTC](https://discuss.prometheus.io/t/filter-specific-metrics-before-scraping/845/4 "2022-03-16T13:01:39Z")

</div>

So you need to check the exporter documentation to see what options there are to choose the metrics being exposed
