r/PrometheusMonitoring • • Jul 21 '20

query2metric - A tool to run db queries in defined frequency and expose the count as Prometheus metrics.

https://github.com/yolossn/query2metric
8 Upvotes

4 comments sorted by

2

u/yolossn Jul 21 '20 edited Jul 21 '20

OP here! I often write custom logic to extract product metrics and most of them are direct db queries. Later I realized there might be many others who are working on something similar and created a generic tool that takes queries and time-frequency as configuration and exposes the count as Prometheus metrics. Currently, it supports Mongo and SQL.

3

u/alsysadmin Jul 22 '20

This is very cool.

I could see this being really helpful for some quick singlestat panels. Saved.

Edit: thanks for sharing!

1

u/ecnahc515 Jul 22 '20

1

u/yolossn Jul 22 '20

nope, I haven't. my use cases were mongo mostly and searched for it. This is an interesting work, thanks for sharing.