openldap_exporter icon indicating copy to clipboard operation
openldap_exporter copied to clipboard

provide a option to collect metrics upon scrape rather than collecting it periodcally

Open LeoQuote opened this issue 2 years ago • 0 comments

https://prometheus.io/docs/instrumenting/writing_exporters/#scheduling exposing metrics using internal scheduling is anti-pattern in prometheus, if we collect metrics when each scrape came in , these are the advantages:

  1. the default up metrics can be used to indicate whether the scrape is a success or a failure.
  2. the scrape frequency can be controlled by prometheus rather than the prometheus and exporter
  3. no hidden outdated data, if the exporter scrape data in backgroud , there is a chance that prometheus get outdated data, the metrics would

there might be disadvantage: if collection of metrics is expensive, like it takes a minute or more to complete, this could be a problem, in which case, a pushgateway may be more suitable.

LeoQuote avatar May 31 '23 05:05 LeoQuote