What Grafana version and what operating system are you using?
Grafana V9.2 in Official docker container.
What are you trying to achieve?
Using the GraphQL plugin I am pulling timeseries data into Grafana. The table after the Graphql query is correctly filled with the correct timerange. The timestamps in the table are all local time, but the query is done with UTC time. I would like to correctly display the queried data in the timeseries graph.
How are you trying to achieve it?
Using grapql plugin to pull in data.
Everything is going well except that the graph is showing the data with the incorrect time values on the x-axis.
In the screenshot below you can see that the data point has an associated time of 16:10:05 (local time) which is correct but the X value in the graph is with one hour offset.
I posted a question about the exact same issue just yesterday. I am pulling data from an MSSQL db and have tried modifying the datetime being returned using select mydate as dt at time zone ‘UTC’ so I’m fairly confident that SQL is returning a binary time value ‘based’ on UTC.
Any idea how how to diagnose what grafana is receiving, or rather what SQL server is sending?
A and B are equal, C is one hour behind. A seems to imply that SQL server doesn’t do any +1 -1 offsetting when you add the ‘at time zone utc’, so I’m not sure what it does do.
I’m going to have to sit down and play with the functions in SQL and try and work out what I need to do so whatever I end up doing doesn’t go wrong after the next summer time adjustment.
Maybe Grafana needs a wiki type page for each data source type so we can add gotchas when feeding it from different sources.
By gotchas, I mean stuff that you know and think is obvious as you are familiar with doing this all day, but things us mere mortals get caught out on.
Much of the documentation on grafana is written for people who are already working with data in the correct format. Those of us who have to write a query to pull some bit of data out of a db just end up staring at a config trying to work out what on earth it is that grafana is looking for when something isn’t working. Date formats are a good example. I’ve been using grafana for a few years, but I had never had to display hourly data until recently, which is when this problem turned up. Group by date has been good enough until now.
We all been there. Remember grafana is a visualization tool, grouping helpers are provided with it by I never use them because they just are short cuts that create generatee code under the hood. I use pure sql functions and aggregators such as group by. So any group by day hour minute or whatever is a task of the database. So if you tighten up your sql coding skills then the rest on grafana aide is easy presentation
Eventually woth this great forum and large army of kind people you will get to where you need. Keep plowing