Extending daily reseting values to midnight

  • What Grafana version and what operating system are you using?
    latest tag on TIG stack via docker compose

  • What are you trying to achieve?
    Achieve a view where the daily resetting vaule is carried through all the way to 23:59:59 (or some other immediate time right before midnight). At about midnight, there should be a vertical line to go down from previous value to zero

  • How are you trying to achieve it?
    Right now this is a basic Time Series chart of the data.

  • What happened?
    Right now, only new values are written to influxdb. These are daily measurements that reset at midnight. So a value that is set at 5PM, will not be written again if it has not changed until midnight when it is reset to

  • What did you expect to happen?
    At about midnight, there should be a vertical line to go down from previous value to zero

I don’t know if this is easily solvable with changing the query on the displaying side in grafana? Or if maybe there is a way to script rewriting the last value into influx right before midnight. It’s only for about 10 entities that I’d like this done.

Hi @poldim

Are you using Flux, InfluxQL, or SQL? Can you share your query that produces the graph?

At first glance, I think your idea of rewriting your script to record a last value just before midnight would be the easiest route to follow.

Hi Grant,

Here is the current query using InfluxQL. The data is stored in InfluxDB 1.8.10.

SELECT distinct("value") FROM "W" WHERE ("entity_id" = 'solark_grid_external_total_power') AND $timeFilter GROUP BY time($__interval) fill(null)

Hi @poldim

I think your best bet would be to record a reading just before 23:59 if you can. That should make your graph appear the way you want it to.

Otherwise, maybe try changing GROUP BY to 1d and see what happens.