Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always align volume range timestamp to end of step #11136

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

trevorwhitney
Copy link
Collaborator

What this PR does / why we need it:
We had originally assumed that it would be weird for a user to get back a timeseries response from volume_range that didn't include a datapoint with a timestamp at the start of their requested range. This was a bad assumption. The volume_range endpoint is inherently doing aggregations. For each step, a datapoint is calculated representing the percent of chunk volumes that the selector appeared in. It therefore stands to reason that the steps volume was not that value until the end of the step time range, as we are to assume volume is monotonically increasing. The fact that we were using the start of the range made it difficult to turn this data into a per-second rate, which this PR aims to fix.

Which issue(s) this PR fixes:
Fixes #11134

@trevorwhitney trevorwhitney requested a review from a team as a code owner November 3, 2023 20:04
@trevorwhitney trevorwhitney merged commit b1f9be5 into main Nov 8, 2023
5 checks passed
@trevorwhitney trevorwhitney deleted the fix_volume_range_timestamp branch November 8, 2023 16:28
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
**What this PR does / why we need it**:
We had originally assumed that it would be weird for a user to get back
a timeseries response from `volume_range` that didn't include a
datapoint with a timestamp at the start of their requested range. This
was a bad assumption. The `volume_range` endpoint is inherently doing
aggregations. For each step, a datapoint is calculated representing the
percent of chunk volumes that the selector appeared in. It therefore
stands to reason that the steps volume was not that value until the end
of the step time range, as we are to assume volume is monotonically
increasing. The fact that we were using the start of the range made it
difficult to turn this data into a per-second rate, which this PR aims
to fix.

**Which issue(s) this PR fixes**:
Fixes grafana#11134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

volume_range timestamps should represent the end of a "step" range, not the beginning
2 participants