Strange interactions with Data outside time range

Hello!

I am migrating a dashboard from simplejson datasource to infinity data source and one of our tables keeps showing the message “Data outside time range”

Image

I have noticed some weird interactions with this.

  1. This is a timeseries using a set time span (usually past 14 days) past 7 days works fine

    it breaks past 8 days.

  2. Any data subset ( using the legend on the right) does not show the “Data outside time range” message

  3. When I try to “Zoom to Data” the graph takes me to an impossible time range with the from after the to date

  1. The actual data being shown behind the message is correct and exactly what I would expect!
  • What Grafana version and what operating system are you using?
    version 11.3.0, windows, microsoft edge

  • Can you copy/paste the configuration(s) that you are having problems with?

I am recieving data in a format that looks like this:

"data": [
                                    {
                                        "metric": "RS",
                                        "time": 1738450800000,
                                        "value": 9
                                    },
                                    {
                                        "metric": "AT",
                                        "time": 1737586800000,
                                        "value": 8557
                                    },
                                    {
                                        "metric": "AT",
                                        "time": 1737673200000,
                                        "value": 119924
                                    },
                                    {
                                        "metric": "AT",
                                        "time": 1737759600000,
                                        "value": 4089
                                    }
] 

I am using a short UQL query to get the data to show in the time series:

parse-json
| pivot sum("value"), "time", "metric"

The table view does not show any irregularities

The effects are the same whether or not I use query options to set the time span or use the dropdown at the top to set it

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    The “Data outside time range message” and this console error which I am unsure is related as it does not appear when refreshing the data

  • Did you follow any online instructions? If so, what is the URL?
    no

Honestly if there was a way to just disable the message pop up I would do that, but if there is a configuration or query error that would interest me as well.

Thank you for reading this post!

Hiya, Welcome to Grafana community. Sorry that you are having issues with migrating from simplejson to infinity. This issue potentially looks like you are passing incorrect timestamps to the underlying API. What does your URL looks like and how you pass the grafana timerange to the underlying API?

Also see if this helps. Basically you need to use time macros to pass the grafana time range to underlying API.

Thank you for your answer!

My REST request is quite simple:
countPerDayByCountry?fromDate=${__from:date}&toDate=${__to:date}

The timestamps themselves seem to get to the backend fine. One thing I think might be the issue is that the timestamp sent by grafana for from is now-X days which would set a lower bound of say Jan 30 12:55 (if 7 days ago) however since the data is based on days there is a data point that is Jan 30 00:00. However this would not explain why it works for data ranges up to 7 days but not beyond.

can you try

countPerDayByCountry?fromDate=${__timeFrom:date}&toDate=${__timeTo:date}

instead? ( because of this issue reported earlier )

While this has not solved the issue, this has shown me an interesting discrepency here:


these pictures were taken using the same dataset just moving the mouse slightly. It seems it is trying to render a data point in the past on the same spot as it the most recent one?
Interestingly enough, going through the dataset, this datapoint doesnt exist anyways and the most oldest timestamp coincides with the expected value 2 weeks in the past 01-23

Can you check the URL in the query inspector to make sure it is passing? does manually calling the endpoint filters data correctly on times range?

Do you mean this?

the times seem to work fine and the request from the backend gives the same result in postman

I’ve been playing around with how to get the same data without the date range message and have found this to kind of do the same thing:

however, the number of things to calculate the total of would be variate, is there a way to specify calc sum ALL other metrics?

Over the weekend, one of the two tables getting this error seems to have fixed itself


I believe maybe the issue is coming from the specific values of the number, maybe its not handling 0s in the time series properly?. However, if I just copy the dataset from the query into a new panel as an inline json data source it works fine.

So this data set (table view) works without the data range message


and this one does not