Quantcast
Viewing all articles
Browse latest Browse all 205

How to display values from rows as data in columns in a table (using data transformation)

Hi,
I recently started my adventure with Grafana and I need to create a panel that will show the storage status of the plugged-in drives to the server. So far, I collect data on computer usage/parameters via the Telegraf plugin and store it in the InfluxDB v2 database (Flux queries). I came across various dashboards on the Internet and a specific panel caught my particular attention.
I have read a lot about data transformation in Grafana, but I still have a problem with processing the data by which the table draws incorrectly.
First of all, I have a problem that the rows are placed as columns.

  • My Flux query is:
  from(bucket: "telegrafRaspberryPi")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "disk")
  |> filter(fn: (r) => r["_field"] == "free" or r["_field"] == "total" or r["_field"] == "used" or r["_field"] == "used_percent")
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
  |> yield(name: "last")
---------------------------------------------------------------------------------------
| device    | path           | used        | free        | total       | used_percent |
---------------------------------------------------------------------------------------
| mmcblk0p1 | /boot/firmware | 77742080    | 26935296    | 104677376   | 74.3         |
| mmcblk0p2 | /              | 99036851136 | 4806443584  | 15519776768 | 67.3         |
| sda1      | /media/pi/3... | 48705605632 | 15717851136 | 64423456768 | 75.6         |
---------------------------------------------------------------------------------------
  • My Grafana version is Grafana v10.2.3 (1e84fede54)

  • I tried many other transformation options, including combining them, but unfortunately I was not able to achieve this.

  • My raw database data (without transformation) looks as follows:

  • Can you copy/paste the configuration(s) that you are having problems with?
    Yes, but what should I show? Tell me and I paste or I show configurations.

  • Did you follow any online instructions? If so, what is the URL?
    Yes, a lot. Youtube videos, Grafana transformation tutorials, etc.

Please help me. Thanks in advance.

14 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 205

Trending Articles