step align start and end time of the original query while splitting it #5217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
In PR #5181, we made a change to step align query splits by step interval except for the start time of the first query and end time of the last query. When the step alignment is disabled, we see a small gap in graphs between the first and second query split since the start time of the query is not step aligned while the next query is.
This PR changes the code to step align all the query splits, including the start and end time of the first and last split.
I will open a follow-up PR to deprecate the step align flag, which does not add much value.
Special notes for your reviewer:
Queries with step > query split interval are splitter by step. These queries' start and end times are kept the same as the original query and are not step aligned since each query split anyways has a single step, so they do not see any gaps. We could do the same for these queries as well, but they are not too common, we on average, see ~1% of this kind of query out of all the range metric queries we get in our biggest cluster.
Checklist