Is a "time shift" or "lag" function on the roadmap?

time
influxql
kapacitor
influxdb
#1

I see this as a possible solution: https://github.com/maxsivanov/influxdb-timeshift-proxy

Follow up question: is there a workaround within Kapacitor?

2 Likes
#2

What is the intended use of this ?
The time shift is available in grafana.

#3

I’m interested in this as well. There were a couple GitHub issues for it that were supposedly aggregated to this issue:

There is an item listed for “lag variables” (although I’m not 100% sure that’s the time-shift function we’re after). There does appear to be user interest, but from what I’ve seen that proxy project is the only workaround currently for Influx. Graphite does have a timeShift() function.

@Luv this would be for trying to display time-shifted data on the same graph (e.g. overlay last week’s data for comparison) vs separate graphs/panels and trying of visually compare.

#4

Hi,
+1 for timeshift or lag to put comparaison in the same graph

#5

Yes, timeshift is definitely on the roadmap. It will most likely make it into an early version of the new functional query language that we’re developing (details here). Then we’ll look at potentially adding it to the SQL version of the query language.

1 Like
#6

Its also currently available if you are using Kapacitor see https://docs.influxdata.com/kapacitor/v1.3/nodes/shift_node/

3 Likes
#7

Does anyone have any approach they’ve taken to compare two separate time periods against each other with data captured with Influx?

My personal solution was to pull the data via GET request, parse via powershell, dump to json and then compare two separate test periods with custom Power BI charts.

I’d prefer some way of figuring out how to leverage InfluxDB directory with Grafana to do this but haven’t found any success stories.

This is for load test periods that need me to present the data more as a relative time from start instead of exact time period details.

#8

+1 for shift. For now I’m able to multiply a first by a last using a WHERE time > now() - 90m, in order to kludge multiplying a value for one hour by than of another, but it’s very kludgy. It would be easier to multiply “last x last but one” in some form.

#9

+1 for timeshift. I’m displaying the energy output of my photovoltaic system in Grafana. I’d like to compare the monthly data with the same period of last year in one graf.

#10

Look at these nice grafs and the comments. THAT’S THE REASON why I’d love to have timeshift supperted by InfluxDB

#11

+15,6 for a timeshift function, it would be…

awesome

#12

@pauldix Does the new query language Flux has timeshift support yet? Can you please share details/documentation on how to use it with Grafana?

Thanks!

#13

Flux supports it. Right now the function is called shift, but there’s an issue to rename it to timeShift: https://github.com/influxdata/flux/issues/810