How to setup scrape interval for sql exporter or a collector #869
-
|
I want to let prometheus scrape sql_exporter every 1 minutes, and I can write it in prometheus.yml but I don't want to put too much workload to database, so I want to let sql_exporter scrape database every 5 minutes. Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hey Xiangyu, Yes, exactly. Setting up A new option introduced recently through a dependency is rate limiting. This requires a separate configuration file and details can be found in the The key difference is that with the default Prometheus/sql_exporter settings of 1m/5m, you risk scraping duplicate data points. However, enabling rate limiting on sql_exporter will trigger an HTTP 429 response, preventing any data from being stored on the Prometheus side. While duplicates aren’t inherently problematic, it’s worth noting their presence. Reference: https://github.com/burningalchemist/sql_exporter/blob/master/documentation/sql_exporter.yml Let me know if you have more questions, I'm happy to assist. 👍 |
Beta Was this translation helpful? Give feedback.
Hey Xiangyu,
Yes, exactly. Setting up
min_interval(either globally or per collector configuration, it's up you) makessql_exportercache the last successful scraped result for a given interval, which in turn protects queried endpoints from excessive usage.A new option introduced recently through a dependency is rate limiting. This requires a separate configuration file and details can be found in the
Miscellaneoussection of the readme.The key difference is that with the default Prometheus/sql_exporter settings of 1m/5m, you risk scraping duplicate data points. However, enabling rate limiting on sql_exporter will trigger an HTTP 429 response, preventing any data from being stored on th…