-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
feat: move detected field logic to query frontend #14212
Conversation
Squashed commit of the following: commit 4d9af56 Author: Trevor Whitney <[email protected]> Date: Fri Sep 20 16:38:03 2024 -0600 feat: move detected fields logic to QF commit a23ea8b Author: Trevor Whitney <[email protected]> Date: Fri Sep 20 14:37:35 2024 -0600 fix: enforce query timeouts and limits commit 2ef80ec Author: Trevor Whitney <[email protected]> Date: Fri Sep 20 13:24:35 2024 -0600 chore: no retries for detected_fields commit c7a471d Author: Trevor Whitney <[email protected]> Date: Fri Sep 20 13:05:33 2024 -0600 feat: return empty result instead of error for failed detected fields queries commit 7b3529a Author: Trevor Whitney <[email protected]> Date: Fri Sep 20 09:39:33 2024 -0600 fix: guard against failed ingester requests for detected fields (cherry picked from commit fbf9018)
@@ -1134,33 +1135,6 @@ func (q *SingleTenantQuerier) DetectedFields(ctx context.Context, req *logproto. | |||
}, nil | |||
} | |||
|
|||
func getParsersFromExpr(expr syntax.LogSelectorExpr) []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.
this wasn't used by anything
this is great! have a few comments.. thank you! |
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.
LGTM
This PR must be merged before a backport PR will be created. |
2 similar comments
This PR must be merged before a backport PR will be created. |
This PR must be merged before a backport PR will be created. |
(cherry picked from commit 36ace66)
(cherry picked from commit 36ace66)
What this PR does / why we need it:
/detected_fields
queries in ops are failing over bigger time ranges in Explore Logs, whereas logs queries for the same time period are not. I think this is because of all the optimizations/protections we have in place for logs queries (result cache, sharding, limits, etc.) that have not been implemented for/detected_fields
. However, since/detected_fields
is just doing aSelectLogs
under the hood in the querier, if we move the detected fields logic up to the Query Frontend we can use the existing limited and filter tripperwares to get the underlying logs. Due to the limits already in place in those tripperwares, they will never return too many lines for the detected fields logic to reasonably handle in the Query Frontend, which allows us to move this logic there without fear of knocking over QFs.This replaces #14210 as it works much better. I have tested in in Ops and it solves the problem without overloading QFs.
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR