If I have metrics named:
statsite.gauges.a-ABC-1.thing
statsite.gauges.a-ABC-2.thing
statsite.gauges.a-CBA-1.thing
Is it possible to group these metrics by a particular fragment, for instance:
statsite.gauges.a-{groupByThisPart}-*.thing
So that I can feed them into another function such as sumSeries.
This is possible by using aliasSub to convert the '-' into '.', as follows, apply:
aliasByNode(seriesName, 2)
which outputs 'a-CBA-1'. Then apply:
aliasSub(seriesName, \d{4})-(\d{4})-(\w{5}, \1.\2.\3)
which outputs 'a.CBA.1'.
Then you can use groupByNode to sum all the parts for the 2nd fragment.
groupByNode(seriesName, 1, sum)