github.com/simpleiot/simpleiot@v0.18.3/docs/user/graphing.md (about)

     1  # Graphing Data
     2  
     3  Simple IoT is designed to work with several other applications for storing time
     4  series data and viewing this data in graphs.
     5  
     6  ## InfluxDB
     7  
     8  [InfluxDB](https://www.influxdata.com/products/influxdb-overview/) is currently
     9  the recommended way to store historical data. This database is efficient and can
    10  run on embedded platforms like the Raspberry PI as well as desktop and server
    11  machines. To connect SIOT to InfluxDB, add a [database node](database.md) node
    12  and fill in the parameters.
    13  
    14  ## Grafana
    15  
    16  [Grafana](https://grafana.com/) is a very powerful graphing solution that works
    17  well with InfluxDB. Although InfluxDB has its own web interface and graphing
    18  capability, generally we find Grafana to be more full featured and easier to
    19  use.
    20  
    21  ### Changing the Display name (labels) in Grafana
    22  
    23  Often with an Influx query, we'll get trace display names that look like the
    24  below:
    25  
    26  ![image-20240319110846431](assets/image-20240319110846431.png)
    27  
    28  Often, much of this data is irrelevant or redundant with the query. One way to
    29  change the label is with a Override:
    30  
    31  <img src="assets/image-20240319111845396.png" alt="image-20240319111845396" style="zoom:50%;" />
    32  
    33  This can be tedious to set up and maintain.
    34  
    35  Often a better way is to
    36  [add tags](https://docs.simpleiot.org/docs/user/database.html#custom-influxdb-tags)
    37  to the nodes generating the data and then display the node tags in the display
    38  name by using the Influx `map` function.
    39  
    40  ```flux
    41  from(bucket: "siot")
    42    |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
    43    |> filter(fn: (r) =>
    44      r._measurement == "points" and
    45      r._field == "value" and
    46      r.type == "value")
    47    |> filter(fn: (r) => r["node.type"] == "signalGenerator")
    48    |> map(fn: (r) => ({_value:r._value, _time:r._time, _field:r["node.tag.machine"] + ":" + r["node.description"]}))
    49  ```
    50  
    51  In this case we are displaying the node machine tag and description. The result
    52  is very nice:
    53  
    54  ![image-20240319112206573](assets/image-20240319112206573.png)