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

Make use of LabelHints.Limit for LabelNames and LabelValues requests (#8805) #10410

Merged

Conversation

santileira
Copy link
Contributor

@santileira santileira commented Jan 12, 2025

What this PR does

Make use of LabelHints.Limit for LabelNames and LabelValues on the StoreGatewayClient, Distributor and Ingester.

Which issue(s) this PR fixes or relates to

Fixes #8805

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@santileira santileira changed the title Use LabelHints.Limit Make use of LabelHints.Limit for label names and values requests Jan 18, 2025
@santileira santileira changed the title Make use of LabelHints.Limit for label names and values requests Make use of LabelHints.Limit for LabelNames and LabelValues requests Jan 19, 2025
@santileira santileira marked this pull request as ready for review January 19, 2025 20:09
@santileira santileira requested a review from a team as a code owner January 19, 2025 20:09
@santileira santileira changed the title Make use of LabelHints.Limit for LabelNames and LabelValues requests Make use of LabelHints.Limit for LabelNames and LabelValues requests (#8805) Jan 19, 2025
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

To me it looks pretty good, but I suggest some improvements.

pkg/distributor/distributor.go Outdated Show resolved Hide resolved
pkg/distributor/distributor_test.go Outdated Show resolved Hide resolved
pkg/distributor/distributor_test.go Outdated Show resolved Hide resolved
pkg/distributor/distributor_test.go Outdated Show resolved Hide resolved
pkg/distributor/distributor_test.go Show resolved Hide resolved
pkg/querier/distributor_queryable_test.go Outdated Show resolved Hide resolved
pkg/querier/tenantfederation/merge_queryable_test.go Outdated Show resolved Hide resolved
pkg/querier/tenantfederation/merge_queryable_test.go Outdated Show resolved Hide resolved
pkg/storegateway/bucket.go Outdated Show resolved Hide resolved
pkg/storegateway/bucket.go Outdated Show resolved Hide resolved
@aknuds1
Copy link
Contributor

aknuds1 commented Jan 23, 2025

Can you rebase on main and squash your commits into one, please? Maybe rebasing will fix the CI failures, since I can't reproduce them locally.

WIP

Add limit field on LabelNamesRequest and LabelValuesRequest

Add support for limit on gateway.proto

Rename variables to keep consistency

Fix tests

Add tests

Add tests

Add tests

Add tests

Add changelog

Fix changelog

Fix tests

Fix imports

empty commit

Update pkg/distributor/distributor.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/querier/tenantfederation/merge_queryable_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/querier/tenantfederation/merge_queryable_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/storegateway/bucket.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/storegateway/bucket.go

Co-authored-by: Arve Knudsen <[email protected]>

Update CHANGELOG.md

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/distributor/distributor_test.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/ingester/client/compat.go

Co-authored-by: Arve Knudsen <[email protected]>

Update pkg/ingester/client/compat.go

Co-authored-by: Arve Knudsen <[email protected]>

Apply suggestions from code review

Co-authored-by: Arve Knudsen <[email protected]>

Apply suggestions from code review

Co-authored-by: Arve Knudsen <[email protected]>

Fix pipeline

Fix tests

empty commit
@santileira santileira force-pushed the santiago.leira/use-LabelHints.Limit branch from fccd555 to 69ea948 Compare January 23, 2025 13:07
@santileira
Copy link
Contributor Author

Can you rebase on main and squash your commits into one, please? Maybe rebasing will fix the CI failures, since I can't reproduce them locally.

done! could you check it again?

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

Looks much better, but there are still some issues.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
pkg/ingester/client/compat.go Outdated Show resolved Hide resolved
pkg/ingester/client/compat.go Outdated Show resolved Hide resolved
pkg/querier/blocks_store_queryable.go Outdated Show resolved Hide resolved
pkg/querier/distributor_queryable.go Outdated Show resolved Hide resolved
pkg/querier/distributor_queryable_test.go Outdated Show resolved Hide resolved
pkg/querier/distributor_queryable_test.go Outdated Show resolved Hide resolved
pkg/querier/distributor_queryable_test.go Outdated Show resolved Hide resolved
pkg/querier/distributor_queryable_test.go Outdated Show resolved Hide resolved
@santileira
Copy link
Contributor Author

Looks much better, but there are still some issues.

@aknuds1 I fixed them. Could you check it again?

@santileira santileira requested a review from aknuds1 January 24, 2025 19:38
@santileira
Copy link
Contributor Author

@aknuds1 is this ready to merge?

@aknuds1
Copy link
Contributor

aknuds1 commented Jan 28, 2025

I plan on reviewing it soon, but it may have to wait until tomorrow. It's been busy.

@santileira
Copy link
Contributor Author

I plan on reviewing it soon, but it may have to wait until tomorrow. It's been busy.

Makes sense. Thanks

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

After changing the changelog item into an ENHANCEMENT (and preferably addressing the two nits), I think this is good to go! @charleskorn do you also want to look it over?

pkg/querier/distributor_queryable_test.go Outdated Show resolved Hide resolved
pkg/ingester/ingester.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@santileira
Copy link
Contributor Author

@aknuds1 done, could you review it again?

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

I'm going to let @charleskorn review. I think he's off work until Monday.

@santileira
Copy link
Contributor Author

LGTM, thank you!

I'm going to let @charleskorn review. I think he's off work until Monday.

Amazing! Thanks

Copy link
Contributor

@charleskorn charleskorn 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 working on this @santileira!

CHANGELOG.md Outdated
@@ -37,6 +37,7 @@
* `cortex_ingester_tsdb_block_postings_for_matchers_cache_requests_total`
* `cortex_ingester_tsdb_block_postings_for_matchers_cache_skips_total`
* [ENHANCEMENT] Compactor: Shuffle users' order in `BlocksCleaner`. Prevents bucket indexes from going an extended period without cleanup during compactor restarts. #10513
* [ENHANCEMENT] Distributor, querier, ingester and store-gateway: Make use of LabelHints.Limit for label names and values requests. #10410
Copy link
Contributor

Choose a reason for hiding this comment

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

I would phrase this in terms a user would understand: something like "add support for limit parameter for label names and values requests"

pkg/distributor/distributor_test.go Show resolved Hide resolved
pkg/ingester/ingester.go Show resolved Hide resolved
pkg/ingester/ingester_test.go Show resolved Hide resolved
@santileira
Copy link
Contributor Author

Thanks for working on this @santileira!

Done! @charleskorn could you review it again? Thanks

CHANGELOG.md Outdated Show resolved Hide resolved
@charleskorn charleskorn enabled auto-merge (squash) February 3, 2025 22:58
Copy link
Contributor

@charleskorn charleskorn left a comment

Choose a reason for hiding this comment

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

Thanks @santileira!

@charleskorn charleskorn merged commit ac097ac into grafana:main Feb 3, 2025
28 checks passed
@santileira
Copy link
Contributor Author

Thanks @santileira!

You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make use of LabelHints.Limit for label names and values requests
3 participants