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

Switch Cortex Ruler to query Query Frontend #5105

Closed
yeya24 opened this issue Jan 29, 2023 · 12 comments · Fixed by #6151
Closed

Switch Cortex Ruler to query Query Frontend #5105

yeya24 opened this issue Jan 29, 2023 · 12 comments · Fixed by #6151

Comments

@yeya24
Copy link
Contributor

yeya24 commented Jan 29, 2023

Is your feature request related to a problem? Please describe.
As we can see from the Cortex architecture https://cortexmetrics.io/docs/architecture/, Ruler queries ingesters (and store gateways) to get data for rules evaluation. This works fine currently but it hard to reuse some features supported in query frontend like vertical query sharding to make rule evaluation faster.

By switching Ruler to query Query Frontend, it simplifies the current architecture to make Query Frontend the entrypoint for both external and internal queries. Ruler components can use less resources as it doesn't need to embed a querier anymore.

Describe the solution you'd like
This feature should be behind a feature flag. If the flag is specified, Ruler will query Query Frontend instead. The implementation should be similar to how Thanos does https://github.com/thanos-io/thanos/blob/main/cmd/thanos/rule.go#L795, by having a custom query func and send HTTP requests to query frontend.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@xuyangwang0825
Copy link

Hi @yeya24!
I'm interested in this issue and would like to work on it under the LFX Mentorship. I've started studying the Cortex architecture and how Thanos do the query.

@yeya24
Copy link
Contributor Author

yeya24 commented Feb 3, 2023

Hi @xuyangwang0825, thanks for expressing interest in this project. Feel free to apply through the LFX website!

@mallikpramod
Copy link

Hello @yeya24
it's Pramod Kumar Mallik, i get to know about cortex quite some day ago and i started learning and searching about it, and i found it quite interesting mainly about partitioning compactor and vertical query sharding.
So i would like to join with this project and being guided by you.

@yeya24
Copy link
Contributor Author

yeya24 commented Feb 19, 2023

Hi @mallikpramod, please apply in the LFX mentorship website but I don't think I am mentoring this project. We have @alvinlin123 and @qinxx108 mentoring it.

@xuyangwang0825
Copy link

Hi @yeya24
May I ask if not receiving any notifications means that I'm not selected for the project? My status on the LFX portal still shows as pending.

@yeya24
Copy link
Contributor Author

yeya24 commented Mar 10, 2023

@xuyangwang0825 Yes, selected mentee name should be in the LFX project page.

@xuyangwang0825
Copy link

🥹

@xuyangwang0825
Copy link

xuyangwang0825 commented Mar 11, 2023

@yeya24

I remain deeply interested in open-source projects in cloud native. However, I recognize that there may be areas in which I need to improve in order to become a better candidate.

Could you please provide me with some feedback on my application? I would appreciate any insights you can offer on which aspects of my background or experience, or skills I should focus on improving.

Thank you so much!

@SungJin1212
Copy link
Contributor

SungJin1212 commented Aug 12, 2024

@yeya24
I interested in this issue. Can I address this issue?
If then, I was thinking I define FrontendAddress in the ruler config. If it is set, the ruler can query to the query frontend. Is it reasonable?

@yeya24
Copy link
Contributor Author

yeya24 commented Aug 12, 2024

Hi @SungJin1212, it would be great if you could start a proposal outlining possible approaches and alternatives.

@SungJin1212
Copy link
Contributor

SungJin1212 commented Aug 12, 2024

@yeya24
I was thinking below approaches. Could you please take a look?

  1. Define queryFrontendQueryable implementing Select func querying to the query frontend using prom client like the thanos.
  2. In ruler init part on modules.go, initiate the manager using queryFrontendQueryable

Sincerely

@SungJin1212
Copy link
Contributor

@yeya24
I make a draft pr. (https://github.com/cortexproject/cortex/pull/6151/files) I would appreciate some guidance.

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

Successfully merging a pull request may close this issue.

4 participants