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

[thanos] Changes to address querying multi cluster reads using thanos query #7781

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

rishabhkumar92
Copy link

@rishabhkumar92 rishabhkumar92 commented Sep 23, 2024

Changes

This change is meant to address querying multi cluster reads using thanos query. I have been trying to make it work with Grafana Mimir backend(Thanos querier -> Thanos sidecar -> Grafana Mimir) which expects X-Scope-OrgID as header for all prometheus APIs. It addresses following fixes:

  • Fixes around way we deals with limit options for metadata API (series, label etc), due to limit being set to 0, metadata APIs were not working (ref)
  • Set tenant header while querying the underlying backend(Mimir in this example) for thanos query and sidecar. Querier needs to set it while issuing grpc request to sidecar and sidecar needs to expect tenant-flag (X-Scope-OrgID in this case) and pass it to underlying backend (Grafana Mimir in this case)
  • Change testcases accordingly

Verification

  • Tested locally for different APIs over Grafana Mimir

cc: @aallawala @callumj @edma2 @GiedriusS

@saswatamcode
Copy link
Member

@rishabhkumar92 could you specify what use case this change fulfils? Not quite sure what you are trying to achieve with this

@rishabhkumar92
Copy link
Author

@rishabhkumar92 could you specify what use case this change fulfils? Not quite sure what you are trying to achieve with this

@saswatamcode I have been trying to use thanos querier + thanos sidecar to query Grafana Mimir which expects X-Scope-OrgID header to set while issuing any APIs (remote-read or prometheus http V1 api) so one set of changes are related to that (passing tenant header from querier to sidecar and sidecar setting it while issuing query to prometheus backend).
Other are related to metadata querying and deal with limits only if it's > 0 due to this. I am also updating description accordingly.

@rishabhkumar92 rishabhkumar92 force-pushed the rishabhk-multi-cluster-reads branch 2 times, most recently from acc2bfa to 5bafa5f Compare September 25, 2024 20:59
Rishabh Kumar added 2 commits September 25, 2024 14:10
… query

Signed-off-by: Rishabh Kumar <rishabh.kumar@airbnb.com>
…g thanos query"

This reverts commit 9cbc630.

Signed-off-by: Rishabh Kumar <rishabh.kumar@airbnb.com>
@rishabhkumar92 rishabhkumar92 force-pushed the rishabhk-multi-cluster-reads branch 4 times, most recently from d68e2f2 to e3669a3 Compare September 26, 2024 00:33
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.

Thanks for your contribution. Why not use something like https://github.com/thanos-community/thanos-promql-connector?

@rishabhkumar92
Copy link
Author

Thanks for your contribution. Why not use something like https://github.com/thanos-community/thanos-promql-connector?

Thanks for suggestion. Using promql-connector will require similar changes like i added in this change but in 2 projects(both thanos and connector) because querier side changes can't be avoided.
Let me know what you think of current change and i can change the name(tenant-header) to something else if thats a concern.

@rishabhkumar92
Copy link
Author

@GiedriusS can you help review this change.

Makefile Outdated Show resolved Hide resolved
Signed-off-by: Rishabh Kumar <rishabh.kumar@airbnb.com>
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.

4 participants