Is there a way to make Prometheus to scrape only the metrics which are present in Grafana? As a customer of Grafna Cloud, I need to minimize the number of DataSeries that are being sent (remote_write) to Grafana Cloud, to avoid being overcharged for metrics that I don't really use.
This can be done by filtering out the metrics that I don't use in my Grafana dashboards, is there a way to do that automatically? Without having to write down all the metric_relabel_configs rules manually?
I haven't found any way to do that, so I created a simple CLI based on Python, which can assist with the task - make sure you don’t scrape metrics in Prometheus, which you don’t present in Grafana dashboards.
frigga - https://github.com/unfor19/frigga