Skip to content
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

Add option to stop reporting deleted resources in Prometheus scrape endpoint #1923

Open
nikosmeds opened this issue Jan 19, 2022 · 7 comments
Assignees
Labels
feature-request New feature requests help-wanted All issues where people can contribute to the project

Comments

@nikosmeds
Copy link

nikosmeds commented Jan 19, 2022

Proposal

Add a setting to stop reporting deleted resources in Prometheus scrape endpoint.

From https://docs.promitor.io/faq#how-does-promitor-handle-deleted-resources

Removed resources will immediately stop being scraped by Promitor, but still be reported in Prometheus scrape endpoint.

Reporting metrics for deleted resources:

  • can be misleading to those viewing the metrics (e.g. this is not standard behaviour for most exporters)
  • leads to false-positive alerts with promitor_scrape_error metric, as the metric returns 1 for any deleted resources
  • unnecessarily stores additional time-series in Prometheus

An option to stop reporting metrics for deleted resources would resolve the above issues.

Component

Scraper

Contact Details

No response

@nikosmeds nikosmeds added the feature-request New feature requests label Jan 19, 2022
@nikosmeds
Copy link
Author

nikosmeds commented Jan 19, 2022

Btw, thanks for Promitor @tomkerkhove - it's really helpful. I understand the FAQ recommends we enable Prometheus metric timestamps - however, this is not an option for us.

A few hours after a resource is deleted, our Prometheus systems with remote-write begin reporting err: out of bounds due to reported time being less than valid time.

@tomkerkhove
Copy link
Owner

tomkerkhove commented Jan 19, 2022

Thank YOU for using Promitor! Always happy to hear feedback or list you as an end-user.

I'm not sure how I can fix this, though, as once it's reported it is still around. I will ask in our depending library.

Update: prom-client-net/prom-client#177

@tomkerkhove
Copy link
Owner

This is coming as per prom-client-net/prom-client#177 and prom-client-net/prom-client#178 so then we can do a more proper clean-up.

However, we would need to check if this is an opt-in or not given others who use timestamps might want to keep them around.

@tomkerkhove tomkerkhove moved this to Proposed in Promitor Roadmap Jan 24, 2022
@tomkerkhove tomkerkhove moved this from Proposed to Design in Promitor Roadmap Jan 24, 2022
@tomkerkhove
Copy link
Owner

This is now supported (see prom-client-net/prom-client#178 & prom-client-net/prom-client#177)

@tomkerkhove tomkerkhove moved this from Design to Todo in Promitor Roadmap Sep 12, 2022
@tomkerkhove tomkerkhove moved this from Todo to Design in Promitor Roadmap Sep 12, 2022
@tomkerkhove tomkerkhove added the help-wanted All issues where people can contribute to the project label Sep 12, 2022
@tomkerkhove
Copy link
Owner

This should be done through a feature flag where the default should be to just keep the metric; to avoid breaking changes.

@phnx47
Copy link
Contributor

phnx47 commented Sep 12, 2022

First, need to upgrade to latest versions of Prometheus.Client packages #1772

@tomkerkhove
Copy link
Owner

Yup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature requests help-wanted All issues where people can contribute to the project
Projects
Status: Design
Development

No branches or pull requests

3 participants