-
Notifications
You must be signed in to change notification settings - Fork 524
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
Query-frontend: Performance Improvements and Refactor #3888
Conversation
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor looks OK. Any idea why this is faster or uses less memory?
@@ -239,20 +245,19 @@ func newMetricsSummaryHandler(next pipeline.AsyncRoundTripper[combiner.PipelineR | |||
// prepareRequestForQueriers modifies the request so they will be farmed correctly to the queriers | |||
// - adds the tenant header | |||
// - sets the requesturi (see below for details) | |||
func prepareRequestForQueriers(req *http.Request, tenant string, originalURI string, params url.Values) { | |||
func prepareRequestForQueriers(req *http.Request, tenant string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this function pretty obscure. Why don't we return a new http.Request based on the original one?
func getQuerierHTTPRequest(origin_req *http.Request, tenant string) *http.Request{
}
That way we will reduce the cognitive overload reading the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer modifying in place to reduce allocs
I removed these calls to I have a follow up PR coming that will remove millions of these calls from the search path. |
What this PR does:
Refactors the frontend to pass a
Request
interface instead of an*http.Request
. This is progress toward supporting deterministic search. Also added a search pipeline benchmark and found a perf improvement inprepareRequestForQueriers
.Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]