Bar Gauge - Manipulate InfluxDB's GROUP BY query results

Hello.

I am designing a Grafana 7.0.3 Bar Gauge panel being fed with data from an InfluxDB instance, but I haven’t found an automatic way of cleaning up the series name for being displayed. And I don’t want to manually map each possible value to what I want to show.

I am calculating the amount of very positive messages sent in each channel from my company’s Rocket.Chat. So, when I apply a GROUP BY clause to my queries, I get something like this as result:

As you can see, it is very uncomfortable for readers to see the results as rocket_chat_message_sentiment.sum {channel: general}. Using ${__series.name} in the Display name property has the same effect.

I started to play around with this and I noticed that ${__series is some sort of a JavaScript object. Something curious happens when I try to apply some built-in function like substr:

The panel somehow detects I am trying to invoke a native function.

I can also treat ${__series.name} as an object and access its index-based properties, but without a function, I don’t have any means of detecting how long each channel name is:

So, to summarize, I have the following questions:

  • Using InfluxDB, how can I display the part of a series’ name between curly braces?
  • Is the series JavaScript object documented somewhere?
  • Can I apply native functions like substr to series objects?

Thanks in advance.