Timeout while collecting metrics #882
-
|
Hello, I have just started using sql_exporter. I added a custom collector to query index fragmentation. Because this collector takes a long time to run, I configured “min_interval: 12h”. My Prometheus scrapes metrics every 15 seconds. However, I observed that each time Prometheus scrapes, sql_exporter prints the following error: In addition, the database also executes the query once for each scrape. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @shukui-ipo, If you scrape metrics from Prometheus every 15s, this literally means you're executing queries on the SQL Server every 15s. The timeouts messages you're hitting are related to that and possibly to Please check the documentation section on the
As for your problem, it depends on how long it takes for your queries to run. The options I see:
|
Beta Was this translation helpful? Give feedback.
Hi @shukui-ipo,
sql_exporterdoesn't scrape targets on its own, the scrapes are controlled and fully performed by the Prometheus instance. In other words, if Prometheus doesn't hit the/metricsendpoint ofsql_exporter, nothing is scraped.If you scrape metrics from Prometheus every 15s, this literally means you're executing queries on the SQL Server every 15s. The timeouts messages you're hitting are related to that and possibly to
scrape_timeoutwhich you've set to1000swhich is 16m.Please check the documentation section on the
scrape_timeout: