- What Grafana version and what operating system are you using?
Grafana v9.5.21 (2dd6ebef03fbe42927769bf00bcf0bc4e621bb9c)
- What are you trying to achieve?
get timestamp of the last metric value and show it on dashboard panel.
- How are you trying to achieve it?
Im using VictoriaMetrics DataSource.
in bash terminal I can request my datasource and can see that the LAST timestamp of metric is - 1735968707000:
#curl -G 'http://localhost:8428/api/v1/export' -d 'match[]={srv_ID="2"}'
..................
{"metric":{"__name__":"T0_0cm","srv_ID":"2"},"values":[-0.44,-0.5,-0.69,-0.69,-0.69,-0.63,-0.5,-0.5,-1.06,-0.56,-0.63,-0.69,-0.94,-0.37,-0.25,-0.25,-0.19,-0.12,-0.19,-0.19,-0.19,-0.19,-0.31,-0.25,-0.25,-0.25,-0.25,-0.25,-0.25,-0.25,-0.31,-0.31,-0.44,-0.37,-0.31,-0.31,-0.31,-0.31,-0.31,-0.31,-0.25,-0.25,-0.31,-0.44,-0.56,-0.5,-0.37,-0.5,-0.56,-0.56,-0.44,-0.37,-0.37,-0.31,-0.31,-0.31,-0.31,-0.31,-0.31,-0.37,-0.37,-0.37,-0.44],"timestamps":[1730362785000,1730363884000,1730884290000,1730884422000,1730896046000,1730955601000,1731042002000,1731128401000,1731214801000,1731301201000,1731387601000,1731474001000,1731560402000,1731646801000,1731733202000,1731819601000,1731906001000,1731993484000,1732078801000,1732165201000,1732251601000,1732338001000,1732425172000,1732510801000,1732597201000,1732684455000,1732770092000,1732856401000,1732942801000,1733029292000,1733115601000,1733202090000,1733288405000,1733375663000,1733462771000,1733547601000,1733634002000,1733720401000,1733806801000,1733894206000,1733981075000,1734066093000,1734152401000,1734238892000,1734326650000,1734412850000,1734584401000,1734670800000,1734757201000,1734845233000,1734931386000,1735017335000,1735103979000,1735190190000,1735276565000,1735363282000,1735449310000,1735535569000,1735621200000,1735709608000,1735794092000,1735880491000,1735968707000]}
...........................
from https://www.epochconverter.com/ it means that timestamp is - GMT : Saturday, January 4, 2025 5:31:47 AM
this is correct timestamp for my metric value.
I want to show it on my dashboard.
this metric “T0_0cm” updates one time per day in the same time at morning.
to get timestamp of the last value of this metric I use this query:
(tlast_over_time(changes(T0_0cm{srv_ID="2"}[24h])))*1000
- What happened?
with this settings it show me correct time but the date is wrong - it always on 1 day after the correct date.
- What did you expect to happen?
it should be Jan 4, but in fact it shows as Jan 5.
Im not sure - where Im wrong? Can anyone point me how to get the correct datetime?