Is it possible to reduce and then join the results of OpenTSDB queries by a tag value for a table?

  • What Grafana version are you using?
    Grafana v8.1.2
  • What are you trying to achieve?

I have multiple OpenTSDB time series each with the same set of tags. For each tag, I’d like to find and display the total of values with that tag for each time series.


Time series 1: [{1, tag=a, time=0}]

Time series 2: [{1, tag=b, time=0}, {2, tag=a, time=1}, {3, tag=a, time=2}]

Desired result: Table with columns [tag, TS1 Sum, TS2 Sum]

In this case it’d look like:

a | 1 | 5
b | 0 | 1

  • How are you trying to achieve it?

Right now I’ve found a very hacky way to do this using a pile of transformations. It works to join 2-3 series this way, but can’t do more and is very inelegant. Is there any better way to do this?