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

Proxy: unify store filtering #7371

Merged
merged 1 commit into from
May 24, 2024

Conversation

MichaHoffmann
Copy link
Contributor

@MichaHoffmann MichaHoffmann commented May 19, 2024

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

In LabelNames and LabelValues gRPC calls were not pruned properly. While results are not wrong, this leads to inefficient fan-out for setups with many endpoints.
We took the opportunity to unify the store filtering and generally also the larger layout of the gRPC methods, including logging and tracing.

Verification

Existing unittests.

@MichaHoffmann MichaHoffmann force-pushed the mhoffm-proxy-store-unify-store-filtering branch from 96bf77c to d86bd0e Compare May 19, 2024 12:50
In LabelNames and LabelValues gRPC calls were not pruned properly. While
results are not wrong, this leads to inefficient fan-out for setups with
many endpoints.
We took the opportunity to unify the store filtering and generally also
the larger layout of the gRPC methods, including logging and tracing.

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
@MichaHoffmann MichaHoffmann force-pushed the mhoffm-proxy-store-unify-store-filtering branch from d86bd0e to 8f7e9ae Compare May 19, 2024 12:58
Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

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

Nice cleanup 👍

return &storepb.LabelValuesResponse{
Values: strutil.MergeUnsortedSlices(all...),
Warnings: warnings,
}, nil
}

func storeInfo(st Client) (storeID string, storeAddr string, isLocalStore bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not make this a struct function?

Suggested change
func storeInfo(st Client) (storeID string, storeAddr string, isLocalStore bool) {
func (st *Client) Info() (storeID string, storeAddr string, isLocalStore bool) {

Also, I'm not a big fan of the use of multiple named returns like this. For example, I think it would be better to implement individual funcs like func (st *Client) IsLocalStore() bool {...}.

@MichaHoffmann MichaHoffmann merged commit 60179ef into main May 24, 2024
20 checks passed
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.

None yet

4 participants