Skip to content

[prometheusreceiver] enable reporting of additional metrics #21064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

premendrasingh
Copy link
Contributor

Feature: Enable reporting of additional metrics for Prometheus client used in PrometheusReceiver

Description:
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.

This PR passes the flag to scrape.NewManager() to enable reporting of metric - scrape_body_size_bytes

Link to tracking Issue:
#21040

Testing:
Added check for validating the value set in testdata/config.yaml

@premendrasingh premendrasingh requested a review from a team April 19, 2023 02:13
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 19, 2023

CLA Missing ID CLA Not Signed

@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Apr 19, 2023
@JaredTan95
Copy link
Member

@premendrasingh thx for your contributions, but you need to fix the CLA first. :-P

@premendrasingh
Copy link
Contributor Author

Cancelling and resubmitting request to fix CLA.

mx-psi added a commit that referenced this pull request Aug 1, 2023
 (#21763)

Feature: Enable reporting of additional metrics for Prometheus client
used in PrometheusReceiver

**Description:**
Prometheus client has a featureFlag options.ExtraMetrics which reports
content size metric
([scrape_body_size_bytes](https://github.com/prometheus/prometheus/blob/main/scrape/scrape.go#L1770))
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.

This PR passes the flag to scrape.NewManager() to enable reporting of
metric -
[scrape_body_size_bytes](https://github.com/prometheus/prometheus/blob/main/scrape/scrape.go#L1770)

**Link to tracking Issue:**
#21040 

**Testing:**
Added check for validating the value set in testdata/config.yaml

---------

Co-authored-by: Jared Tan <[email protected]>
Co-authored-by: Pablo Baeyens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
receiver/prometheus Prometheus receiver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants