-
Notifications
You must be signed in to change notification settings - Fork 557
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
querier,ingester: support for limit parameter in the finding series endpoint #10620
Conversation
e0c1de1
to
381c2a6
Compare
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.
easy, LGTM with two small suggestions
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.
Nice work! I left a comment about where to apply limit in a function.
pkg/distributor/distributor.go
Outdated
for _, m := range metrics { | ||
if len(result) >= resultCap { |
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.
Why not limit few lines above when we populate metrics
to deduplicate series? We could just stop once len(metrics)
reached the limit.
Similarly, I'm wondering why we don't apply the limiter in the same for
loop above when we populate metrics
. Do you see a good reason to not do it there?
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.
Do you see a good reason to not do it there?
I think, the only one is that, in the worst case, this will check every duplicate against the series limiter, calculating the hash of the series twice. I cannot tell if that better or worse, from applying this limit later.
Note I'll skip looking into this part. We can benchmark different options separately.
Signed-off-by: Vladimir Varankin <[email protected]>
Signed-off-by: Vladimir Varankin <[email protected]>
Signed-off-by: Vladimir Varankin <[email protected]>
Co-authored-by: Marco Pracucci <[email protected]>
Signed-off-by: Vladimir Varankin <[email protected]>
Signed-off-by: Vladimir Varankin <[email protected]>
Signed-off-by: Vladimir Varankin <[email protected]>
df94c31
to
9a952b1
Compare
What this PR does
This PR updates the
querier
and theingester
services, with a basic support for thelimit
parameter in the/series
API endpoint.Here the code only passes the limit to the downstream services, as-is. This is not ideal, because the limit of MM series in the distributor can overwhelm the ingesters. I want to focus on that in the follow-up PR to make the review simpler.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.