sql_exporter
sql_exporter copied to clipboard
added extraction of labels from JSON column
Hi, you might not like it, but I've implemented it works ;-)
This change introduces new metric option json_labels that specified a column that should be used to extract additional labels to metric, without the need to name them one by one in the query. If some style/whatever changes needed to merge it, I'll make them.
-
yes you can, but than you have to change configuration. I kind a like it, when everything about database is declared in database, even what is monitored and what labels it has - ie. if there is bool metric (ok/down), than the evaluation logic should be in database view and not in the query in some config file - and if it is so, why not to extend this logic to labels ;-)
-
Regarding fully dynamic labels - I know that prometheus will refuse different labels for the same metric and that is correct and expected. They should not be absolutely dynamic.
But ok, thanks for your review.