Closed almajed-smsc closed 4 months ago
Did you find a way of achieving that? I believe there's a PromQL query to get the timestamp of the last time the metric was seen?
I did not know about sql_exporter_last_scrape_failed
My workaround was using last failed scrape.
The alert rule is:
if sql_exporter_last_scrape_failed{query='CheckHealth'} == 1 # The query failed to be executed for whatever reason
CheckHealth query does nothing but return 1000 (SELECT 1000)
It would be really great to have a flag just under the job which force reporting to prometheus if the query failed.
The Idea here is let's say we want to check server is up by sending below query
SELECT 1;
I want to know if this query failed or if no response or an error happened, so I can send an alert if value of count is null !