Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aggregateWindow aligned to specified timezone

Given the following query in Influxdb's Flux language:

from(bucket: "some-great-metrics")
   |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
   |> aggregateWindow(every: 1mo, fn: sum)
   |> yield() 

Assuming my current timezone is PST. How to ensure that aggregateWindow respect the beginning and end of the 1mo duration in this specific timezone (PST)?

Searching in the documentation does not bring so much light to me, so far.

like image 974
GreNodge Avatar asked Nov 15 '22 00:11

GreNodge


1 Answers

Seems like Influx 2.1 comes with a new Flux timezone package

You can try to upgrade to 2.1 and add this before your query:

import "timezone"

option location = timezone.location(name: "America/Los_Angeles")
like image 125
Bertrand P Avatar answered Dec 15 '22 01:12

Bertrand P