Description
Component(s)
receiver/prometheus
Is your feature request related to a problem? Please describe.
We use prometheus receiver to scrape metrics, however many times the prometheus endpoints return huge number of time series. We use body_size_limit to drop data but there is no way to report for which endpoints the data has been dropped.
Prometheus client has a featureFlag options.ExtraMetrics which reports content size metric (scrape_body_size_bytes) for successful scrapes and -1 for dropped data. This metric will help us collect data and setup alert for dropped data. However the prometheus receiver does not have a way to enable this feature flag. Please suggest a solution to enable this metric - scrape_body_size_bytes
Feature flag used for collecting metric
https://github.com/prometheus/prometheus/blob/main/scrape/scrape.go#L1798-L1808
Describe the solution you'd like
New scrape manager is created in PrometheusReceiver here, it can be enhanced to pass a flag to enable ExtraMetrics in Prometheus client.
For example something like
r.scrapeManager = scrape.NewManager(&scrape.Options{PassMetadataInContext:true, ExtraMetrics:r.cfg.ReportExtraMetrics}, logger, store)
Describe alternatives you've considered
No response
Additional context
No response