How to display yesterday’s and today’s data in one panle.
I used “Time shift”, but it will take effect on all configurations,This is not what i want.
Is there any other way to display the data of today and yesterday at the same time in one panle?
If you are using Flux then there is a timeshift function: https://docs.influxdata.com/flux/v0.65/stdlib/built-in/transformations/timeshift/
If you are using InfluxQL then no. There is this project: https://github.com/maxsivanov/influxdb-timeshift-proxy
And in the next release of Grafana we might be releasing a feature that adds functions like timeshift to all query languages that don’t support them natively. But it might get postponed to a future release.
ok.thx.
By the way, which version will support this feature.
Either 7.0, 7.1 or 7.2. It is this experimental feature that we are trying to figure out exactly how it should it work in the UI: https://github.com/grafana/gel-app
If using grafana $range for main FLUX query, and have a dashboard variable $dOffset=1d what is the FLUX syntax in alternate query that would apply the time shift to $range??
To clarify further: I don’t want to shift the time stamps of my results by the time shift offset, I want to shift the timepicker $range by the Time shift to select prior day data from my measurement (in subsequent query)
I support @daniellee 's response regarding the timeshift function in Flux. Also see my response in: Transitioning from InfluxDB 1.x InfluxQL to 2.x Flux query language
While I agree that would be desirable I’m wondering if some of the new 7.1.2 options help allow for a workaround:
-
${__from:date}
no args, defaults to iso/rfc (example 2020-07-13T20:19:09.254Z) -
${__from:date:iso}
same as above -
${__from:date:ms}
unix millisecond epoch same as no date format${__from}
-
${__from:date:seconds}
unix seconds epoch -
${__from:date:YYYY-MM}
custom date format
If one flux query (oss 1.8) with __from and __to can also support a second query in same panel using one of the above techniques for range to be: __from -3d to __to -3d. (Where 3d is selected from dashboard variable)?
Trial and error is tough. Sample code snippets go a long way!
#whereareallthebloggers