ukwa / ukwa-monitor

Dashboard and monitoring system for the UK Web Archive
0 stars 5 forks source link

Stats Pusher to allow the same metric with different labels #20

Closed anjackson closed 2 years ago

anjackson commented 3 years ago

It's often handy to use the same metric with different labels, as it makes breakdown analysis easier. I wanted to do something like this:

trackdb_numFound = #######
trackdb_numFound{label='warcs'} = #####
trackdb_numFound{label='cdx'} = ####

i.e. use the label to count sub-sets of the total number of files found in TrackDB. However, because the metric name (trackdb_numFound) is constructed from the JSON dictionary keys, and we only have one metric definition per key, we can only use each metric name once. The meant to get it to work I had to use:

trackdb_numFound = ######
trackdb_numFound_warcs = #####
trackdb_numFound_cdx = ####

Which is not so easy to use.

anjackson commented 2 years ago

This was implemented!