sumSeries() for templated query

I have a query as follows:

sumSeries(servers.test_server.$host.$tenant.ps.example_query_for_[[tenantnumber]]_question.average)

The [[tenantnumber]] template variable has about 10 or so values to it, so what I want to see is those 10 nodes being graphed individually, but the sumSeries should sum up the all the hosts and tenants I choose, so for instance, if the tenantnumber is 5, I’d like to see:

servers.test_server.(host1+host2+host3).(tenant1+tenant2).ps.example_query_for_5_question.average

That would be if only tenantnumber 5 was selected, and if I choose All numbers from a dropdown, it should graph all 10 series for all the 10 tenant numbers, but each of those series should have the hosts and tenants summed up into a single series.

Sorry if that’s a little confusing, but I tried groupByNode and sumSeriesWithWildcards, etc, but I didn’t know how to make this work or if it’s possible.

Your question is hard to understand.

Does this work the way you want? (and why are you summing averages?)

A groupByNode would usually be the function you would use for this and then you would group by example_query_for_[[tenantnumber]]_question. What result do you get when you try?

Your using the sumSeries function, it will combine all the series into one series (summing the values from each series).

If you want one series per tenant and sum all hosts use groupByNode(3, ‘sum’):

example: http://play.grafana.org/dashboard/db/group-by-node?panelId=1&fullscreen&edit&orgId=1

Ahhh yes sorry! Just noticed groupByNode was working the way I wanted. I didn’t verify my data well enough when comparing all manual queries on a chart versus using the groupByNode… super useful feature, major timesaver.

Thanks guys!