-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Disable chunk trimming in Receivers #7815
Conversation
Start: r.MinTime, | ||
End: r.MaxTime, | ||
Limit: int(r.Limit), | ||
DisableTrimming: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually both engines will skip samples outside of the range, so we should be safe here. Technically we don't really trim chunks from Store Gateway so the same idea applies there.
0aa023b
to
96917e5
Compare
Forgot to sign DCO and had to force-push. |
Do we need changelog for this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's double check we are explicitly stating that in Series
gRPC API too (that time matcher is "best-effort" to some extend).
I think we already do that in sidecars
When trimming is not disabled, receivers end up recoding all chunks in order to drop samples that are outside of the range. This ends up being very expensive and causes ingestion problems during high query load. This commit disables trimming which should reduce CPU usage in receivers. Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
8fcffcb
to
328385a
Compare
I've extended the godoc on the Series RPC to mention that chunks don't need to be within the exact range. I think this is good enough for now and we don't need a changelog entry because the change is not user facing. |
@fpetkovski Is there a user facing behavior change if we do this? Does it change any of the query results?
From this comment I guess there is no user facing changes if we change it? |
The engine will discard samples outside of the query range, so results are not affected in any way. IMO a changelog entry should not be needed for Thanos users, but we can add one if you still think it is necessary. |
@fpetkovski Thanks. If there is no user facing change then let's skip the changelog. |
@MichaHoffmann pointed me to the acceptance tests we run from the Prometheus repo itself: https://github.com/thanos-io/thanos/blob/main/pkg/query/query_test.go#L53. So I think we should be good. Also store-gw has the same behavior which I think hasn't shown any problems so far. |
This change is motivated by the following Slack discussion: https://cloud-native.slack.com/archives/C02KR205UMU/p1728575718863519
When trimming is not disabled, receivers end up recoding all chunks
in order to drop samples that are outside of the range.
This ends up being very expensive and causes ingestion problems during high
query load.
Trimming will be triggered in the following case:
This commit disables trimming which should reduce CPU usage in receivers.
The engine already skips samples outside of the query range, so correctness will not be affected.
Changes
Verification