Get last value even if outside of time

  • What Grafana version and what operating system are you using?
    v9.4.7

  • What are you trying to achieve?
    get the last value, so there is always a value displayed, even if not:

  • What happened?
    Due to API Limitations I can only fetch data very rarely. Some components does only work with “Event Polling”. So there could be the same data for a long time.

  • What did you expect to happen?
    As said, it is possible that the last entry in db is like 3 days ago, but the value never changed (i just don´t save the same value again, due to very high db usage)
    So currently, if I have the same value a long time, there is no data displayed anymore. Currently I fill in the gaps with previous or linear. But as soon as the last point is out of time I get no data display.
    My goal:
    Always have last data fillable with previous or linear even if out of time scale

  • Can you copy/paste the configuration(s) that you are having problems with?
    My query:
    SELECT mean("value") FROM "..." WHERE $timeFilter GROUP BY time($__interval) fill(previous)

Welcome

What is your data source?

What do you mean?
I use InfluxDB with Node-RED.

If it’s not what you wanted, please let me know
I am relatively new to grafana/influx

Thank you

1 Like

Hi @vito0912,
Maybe you can just set longer time range for that specific panel like on next link?:

https://localhost:3000/t/each-panel-has-its-own-timeline/79929/4?u=ldrascic

All other panels on that dashboard would have time range from time picker (in upper right corner).

 

Best regards,
ldrascic

so it looks like you are using influxql query language on influxdb. I wonder if there is a way to check the value of mean and conditionally choose the following use of last?

select last(field_1),* from measurement group by *

Thanks for your idea. However, this would only delay the problem and break the statisics, since a 6h view should be the case with me

It seems to work kind of. I modified it a little bit to work with my needs. It now finds the data (the % at top right is shown correctly). And also shows “data outside time range”. But it doesn´t show a graph. Even when using fill(previous)

F is my normal
H is “yours”

what does the data tab show, behind the graph