-
What Grafana version and what operating system are you using?
Yet to install Grafana but will be running on Rasp Pi / Debian -
What are you trying to achieve?
I am writing a python program that outputs statistical data for various time periods: -
data A for each device 1, 2, 3 for period 1 (e.g. 4 mins)
-
data A for each device 1, 2, 3 for period hour
-
data A for each device 1, 2, 3 for period day
-
data B for device 4 for period hour
-
data B for device 4 for period day
All the data is cumulative values for the period -
How are you trying to achieve it?
The data is being sent as MQTT/json with different topics and it is intended to store it in an influxdb database before processing by grafana
The data is timestamped, e.g. “dateTime”: “2021-09-20 23:52:38” -
Issue
The time periods are triggered by python timers and in the case of data B there are slight delays to ensure that the data A has been processed.
So for example the last hour’s data A on 2021-09-20 is timestamped “2021-09-21 00:00:00” (i.e. the next hour/day) and the data for B for the whole of the same day is “2021-09-21 00:05:00” (i.e.next day).
-
Question
How should I timestamp cumulative data so that it is analysed and reported in grafana for actual hour/day that the data represents?
I would for example, expect a graph of data for each hour in a day to have the last hour labelled as 23 or 23:00-23:59
For instance, should I subtract x secs from the current time so that the timestamp is the end of the previous hour/day?
I’m sure that this is a issue that applies to all time series data but it’s years since I created any such data.
Thanks
Alan