As the metrics are fetched from varnish during a scrape request, the scraping gets slower with more backends. Due to that old backends are not removed (for a while), the number of backends can increase quickly in a CI/CD environment. This causes scrapes to take longer, and take up resources in prometheus.
Generally what you'd want to do in a 'heavy' scraper as this one, is fetching metrics on a Timer.Tick and keeping them. If you fail to get metrics on the next tick, you can empty the cache as well, to signal to prometheus that something failed.
6.3.1
1.5.1
As the metrics are fetched from varnish during a scrape request, the scraping gets slower with more backends. Due to that old backends are not removed (for a while), the number of backends can increase quickly in a CI/CD environment. This causes scrapes to take longer, and take up resources in prometheus. Generally what you'd want to do in a 'heavy' scraper as this one, is fetching metrics on a Timer.Tick and keeping them. If you fail to get metrics on the next tick, you can empty the cache as well, to signal to prometheus that something failed.