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

Why preemptively query Sia API? #4

Open
forresthopkinsa opened this issue Aug 28, 2021 · 2 comments
Open

Why preemptively query Sia API? #4

forresthopkinsa opened this issue Aug 28, 2021 · 2 comments

Comments

@forresthopkinsa
Copy link

Querying the Sia API and then caching the results for Prometheus to later scrape seems to be at odds with the general Prometheus pull-oriented design.

Why not query Sia in response to a Prometheus request? That way, the metrics collection frequency would be solely managed with the Prometheus job scrape interval.

@mattlqx
Copy link

mattlqx commented Sep 3, 2022

This actually is how Prometheus pull design works in every exporter I've seen. Metrics are collected at an interval and state held in memory so that when a request to /metrics comes in, it's just dumping that state and not having to connect out and wait for a result to then be relayed back to Prometheus or whatever consumer.

@forresthopkinsa
Copy link
Author

Weirdly, that's been the opposite of my experience. Additionally, this is called out in the Prometheus documentation:

Metrics should only be pulled from the application when Prometheus scrapes them, exporters should not perform scrapes based on their own timers. That is, all scrapes should be synchronous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants