New column not available in grafana

So I’m quite new with grafana & Influxdb so apologies beforehand if this a silly question.

I have an influxdb database that i’m accessing via flux.

I use the following query:

from(bucket: "myDatabase")
  |> range(start: 2021-07-09T12:08:09Z, stop:2021-07-09T13:08:09Z)
  |> map(fn: (r) => ({ r with newcolumn: "This column is not available in grafana"}))

When using this query in the influx cli I have a nice extra column called “newcolumn”. But when using it in grafana this column is not visible. This is the case with all newly generated columns (works in the cli but not visible in grafana).

What am I doing wrong?


Maybe it has something to do with Flux being beta in Grafana, I’ve tried some of the functions within Grafana with limited success. What I’ve done is manipulate the data in Influx using Flux (ie. create my additional columns, calculations etc) then out put my results to a new bucket. In Grafana I query my new bucket that has all the columns I need and work on the visualizations with my new base data set.

This may not be the best way but I’m new to all this also and it’s the only way I’ve gotten things to work the way I want.

Oof, that’s annoying but I completely overlooked the fact that it was in beta. But that can explain it! Good to know that i’m not the only person with flux issues.

Thanks for the suggestion! I’ll check out your solution. Seems reasonable enough.