chop-dbhi / prometheus-sql

Service that exposes Prometheus metrics for a SQL result set.
BSD 2-Clause "Simplified" License
202 stars 55 forks source link

return value-on-error when can't connect to database #20

Closed yosefy closed 6 years ago

yosefy commented 7 years ago

there is this option: value-on-error: '-1' but when cant connect to db we get "404 page not found"

so i cant alert on it

need to get value-on-error value instead

thanks

haxorof commented 7 years ago

value-on-error was introduced to make it possible to see that a query fails for some reason instead of the previous behavior where the query did not even appear in the metrics endpoint.

@yosefy Where do you see the 404 error? directly accessing the db? I guess it is not when you scrape the metrics endpoint in prometheus-sql because that should show you -1 for that query if you defined that configuration.

Cheers!

yosefy commented 7 years ago

yes the value is for connecting to mssql db server

haxorof commented 7 years ago

Not sure about creating a more dynamic mechanism for value-on-error at this time because it might tend be unforeseen side-affects which might complicate the understanding of the mechanism.

It feels to me when you have a connectivity issue with the database it might be better to have the alerting closer to it to understand exact reason. Seeing for example -1 in the metric registered in prometheus-sql can be an indicator for underlying problem or query issues.