Identifying identical queries from different influxdb datasources

Howdy, I’ve two data sources, each running the exact same InfluxQL memory usage query, returning data in table mode. Both return a series called “mem”, the name of the measurement in question. I want to merge these two data sources, and in a Bar Gauge panel access the query name or such, that will let me tell the otherwise identical looking data apart, so I can color code the text etc.

Any tips on how I could possibly find the name of the query or some other way? InfluxQL is limited in not being able to add or manipulate text strings, so I see no way to actually usefully change / augment the data itself.

If both have a common field you could use join Transformation?

All fields are common, it’s two different clusters of AWS instances. but it’s only basic OS performance info, nothing to identify which of the two environments any given line came from.

In fact though, I have been able to insert a really ugly integer value in InfluxQL

SELECT ... (used_percent * 0) + 1 AS env ...

As you MUST reference a variable in every value you select, so this does let me insert a value, 0, 1, 2 etc. to later use in a Value Mapping, but it’s pretty horrible a solution, and I’d like to think I can get a similar effect without modifying the raw query. Grafana knows which query the data came from at some level, so would be good to be able to use that knowledge.

I can filter a transformation to only cover a single queries output, but I don’t see anything useful I can do when in that situation anyway.

Maybe business chart plugin with JavaScript?