Skip to content

Conversation

andrejbranch
Copy link
Contributor

@andrejbranch andrejbranch commented Mar 3, 2025

This allows limiting the result sets of values calls, which can significantly reduce the payload for high cardinality metrics with 100k+ values.

A next step to this might be getting values in batches here and intersecting the postings batch by batch until limit is reached which could improve memory and latency for calls that have a specified limit. Though this seems like a reasonable starting point.

Signed-off-by: Andre Branchizio <andrejbranch@gmail.com>
@krajorama
Copy link
Member

Let's reference #14109 as priory art.

Copy link
Member

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this; I made a few stylistic points.

@bboreham bboreham changed the title Allow limiting label values calls [PERF] TSDB: Pass down label value limit into implementation Mar 11, 2025
Signed-off-by: Andre Branchizio <andrejbranch@gmail.com>
@andrejbranch andrejbranch requested a review from bboreham March 11, 2025 13:43
Copy link
Member

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@bboreham
Copy link
Member

bboreham commented Apr 7, 2025

BTW the description is a bit confusing to me as someone who doesn't work on Thanos.
This PR stands alone as an improvement to Prometheus, right?

Copy link
Contributor

@harry671003 harry671003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM!

@bboreham bboreham merged commit b07b552 into prometheus:main May 6, 2025
27 checks passed
Shuimo03 pushed a commit to Shuimo03/prometheus that referenced this pull request May 8, 2025
…eus#16158)

* allow limiting label values calls

Signed-off-by: Andre Branchizio <andrejbranch@gmail.com>
Signed-off-by: WuLiang <wu1998102@gmail.com>
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.

4 participants