Skip to content

Conversation

@vadimalekseev
Copy link
Member

Describe Your Changes

A simpler solution (compared to VictoriaMetrics/VictoriaMetrics#9301) to the problem described here: #78.

This implementation does not require adding additional pipelines to shift the timestamp. Instead, it applies a time offset directly within each time filter. In the case of 'hits' and 'range' handlers, it adjusts the timestamp to align with the current time.

LogsQL example:

options (time_offset=7d) _time:1h | stats count() as 'count 7d ago'

@valyala valyala merged commit 8b22bc6 into master Aug 10, 2025
3 checks passed
@valyala valyala deleted the time-offset-option branch August 10, 2025 19:06
@valyala
Copy link
Contributor

valyala commented Aug 10, 2025

@vadimalekseev , thank you for the implementation of the time_offset option!

valyala added a commit that referenced this pull request Aug 10, 2025
Previously the time_offset option from the top query was mistakenly applied to all the subqueries.

This is a follow-up for 8b22bc6

Updates #78
Updates #414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants