Adding metrics together in InfluxDB/Grafana

Hi All,

I posted this question in the Influx community forums but they don’t seem to be very active, it seems a bit more lively here!

I’m graphing two metrics in Grafana, which are as follows:
SELECT last(“value”) from “broker_to_client_connections” where hostname = ‘host’ and metric = ‘\"\Broker()\Broker to Client Connections\"'
and
SELECT last(“value”) from “broker_to_webclient_connections” where hostname = ‘host’ and metric = '\"\Broker(
)\Broker to WebClient Connections\"’

It’s pretty self explanatory but the first query find the number of users connected via a desktop client, and the second via a web/mobile client.

I would like another display of total number of connections, so I’ll need to add the above metrics together. Is this possible?

Many thanks in advance

Yes, combine them in one query and use regex for the table name. Here is one example if you search the forum here you can find more examples.

The docs have a few examples of queries using regex too.