Replacing Series Labels from another DataSource?

  • What Grafana version and what operating system are you using?
    Im using Grafana 11.0 on Linux

  • What are you trying to achieve?
    I’m trying to create a panel from a CloudWatch timeseries data of cpu utilization. The cloudwatch data from Query A only displays a time, i-XXX InstanceId and the CPUUtilization value. The users are stating that they need the i-XXX InstanceID values mapped to an alternative ServerName value. I have created a 2nd data source, Query B, as an Infinity extracted JSON file that contains only the i-XXX values and their equivalent ServerName value. I need to replace the i-XXX values with a ServerName value from the 2nd datasource.

  • How are you trying to achieve it?
    If I create a mixed datasource, I can successfully retrieve both queries from the 2 datasources but I cant replace the series I-XXX values with the ServerName details from the 2nd datasource.
    I’ve tried joining the datasets with join by field and join by labels but neither create a single dataset that I can see.

  • What happened?
    I can see either the 3 columns of the A query or the 2 from the B query but not merged together

  • What did you expect to happen?
    I need to see the data in the format in a timeseries graph where the series labels use the replacement ServerName values tather than the I-XXXX values.

I’m sure that this cant be too difficult but I just cant seem to crack this…

Cheers

Shaun

Can you provide some sample data and some screens? Join by field transformation should do the trick.

Heres my query config so far…

and this is the source data from cloudwatch. I need to replace the i- values (of which there are about 70) with the equivalent servername from the 2nd file…


When i try to join by field, these are the values that i get to join by, but none of them seem to work…

I get the InstanceId and Name to match but the rest of the data seems to be lost…?

From the query inspector, I looks like in the first query, I’m returning lots of frames and rows.

Not sure if my issue is that I’m trying to join a multi-array timeseries with a table…?

Ok, now I get why this transformation is not working. You don’t want to join values but rather field names. I don’t think it’s possible unfortunately, at least in vanilla Grafana. You can try with Business Charts - AFAIK you plot graphs with JS, so it would be possible / easier to do that with JS code. I don’t think Grafana transformations allow something like that.

You could try to use Reduce transformation, then join by field, and then unreduce but I don’t know if that’s possible either :pensive: