albertodonato / query-exporter

Export Prometheus metrics from SQL queries
GNU General Public License v3.0
436 stars 101 forks source link

Add a builtin metric of query_timestamp - reporting last time query_exporter ran the query #178

Closed lchopfpt closed 8 months ago

lchopfpt commented 8 months ago

Is your feature request related to a problem? Please describe. As an operator, I need to know when the last query ran, so I can be sure I have up to date information. This is particularly helpful if perhaps there's an issue with query_exporter, the db connection or the query itself.

Describe the solution you'd like Add a builtin metric for each query that is the "last query run time", something like query_timestamp.

Describe alternatives you've considered I have a work around by adding to add as a field for each of my queries... This doesn't always make sense though.

albertodonato commented 8 months ago

Thanks for the suggestion, this is now available in main.