need to create alert if I don’t have any payment till noon in specific timezone (Influx OSS v2.7).
trying to do it through task (code below),
but as we don’t have possibility to start task in specific timezone,
need to calculate offset between my specific timezone and UTC considering DST on the task side, to use it in task option as start offset.
in this post
was mentioned that timezone.location change now() to timezone time, but test this on
You can shift the queries and get data for a particular timezone and you can adjust the offset to get it to run at the start of your day like you’ve done. The timezone affects how time is interpreted within the Flux script, but not when the task itself runs. But you can’t get the offset value afaik. You’ll have to offset it manually I believe. For your specific use case of checking payments by noon in a specific timezone, you can use the offset parameter in aggregateWindow() to shift window boundaries as well.
So said another way, for your specific requirement to check for payments by noon in Kiev time:
Use a cron expression to run at UTC time that corresponds to noon in your timezone
In your Flux script, use the timezone option to ensure proper time interpretation
Use the appropriate range and filter to check for payments