Example of "Labels to fields" transform (with Influx data)?

Can anyone point me to a working example of a “Labels to fields” transformation? Ideally applied to Influx data, but I’d take more or less anything as a starting point.

The example in the docs seems simple enough - but when I try to reproduce it on my own data, the “Value field name” drop-down always shows “No options found”. I’ve not found anything relevant on play.grafana.org. Maybe there’s some dependency that I’m just not getting?

This is related to a broader endeavor, which I’ve documented in another post here - and for now it has me stumped.

1 Like

I have never tried using that Transformation until just now, and also could not get it to work with either MSSQL data or Influx Data, and also tried multiple visualizations (although the docs seem to indicate it only works with Tables). In all cases, I could only get the dropdown to display “No options found”. I am using 7.5.7. I will try to play around with this later to see if I can get something to show up in the dropdown.

2 Likes

Just wanted to bump this. Would love to get some input on how to get it working - as it would potentially save us the considerable effort of implementing a workaround.

I tried this out for myself (alas with Prometheus).

So without the transformation, I’m getting a time series with two fields (and many labels).

With the Labels to fields transformation applied, all the labels have been extracted to individual fields, e.g. cpu, instance, job, and mode.

By setting the Value field name, I can essentially group by the values of the selected label. Note that the Value field has been replaced with idle, iowait, and irq which all are values in the mode field.

If the Value field name box doesn’t list any labels, I suspect that it has something to do with the format that InfluxDB returns. I’ll get back to you once I’ve found a InfluxDB setup to test this one.

1 Like

It looks like this may have been fixed sometime between my original post, and now (v8.1.0-beta1) - possibly by this PR. Influx tag names now appear in the “Value field name” drop-down.

1 Like