Labels to fields transformation

Hello, can’t figure out how labels to fields transformation works.

Using MySQL datasource with the query:

select unix_timestamp(‘2020-07-07 11:34:20’) as time, ‘Server A’ as Server, ‘EU’ as Datacenter, 1 as Value
select unix_timestamp(‘2020-07-07 11:34:20’) as time, ‘Server B’ as Server, ‘EU’ as Datacenter, 2 as Value

Only I can get after applied “Server” as Value field name is:

By some reason column “Datacenter” becomes “Datacenter 1” and “Datacenter 2”, while my expectation is 1 column “Datacenter” with “EU” value as described in documentation:

Grafana version 8.1.2, OS Debian 10

The short story here is that this doesn’t work for SQL data, only for timeseries data (Prometheus, Influx, …).

I struggled through this a fair bit and recorded my findings in this thread/post that would hopefully be helpful: Using SQL data to label time series (via v7 transformations?) - #3 by svetb

In summary, this should be implemented at some point, but is dependent on a still-open GitHub issue.

This topic was automatically closed after 365 days. New replies are no longer allowed.