-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
fix(detected_fields
): return parsed labels when parsers are passed
#14047
Conversation
@@ -1075,6 +1076,8 @@ func (q *SingleTenantQuerier) DetectedFields(ctx context.Context, req *logproto. | |||
if err != nil { | |||
return nil, err | |||
} | |||
// just incject the header to categorize labels |
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.
// just incject the header to categorize labels | |
// just inject the header to categorize labels |
detected_fields
: return parsed labels when parsers are passeddetected_fields
): return parsed labels when parsers are passed
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.
Looks good! I would love a benchmark to see how this affects the performance, but given that it's currently broken without this I think we should merge and worry about performance later (ie. make it work before we make it fast).
…14047) Co-authored-by: Galen Kistler <[email protected]> Co-authored-by: Trevor Whitney <[email protected]> (cherry picked from commit aa1ac99)
What this PR does / why we need it:
The
detected_fields
API accepts a full "logQL" query to be passed. This includes parsers. If parsers were passed, theSelectLogs
statement would parse labels into thestreamLabels
property. That would then cause thedetected_fields
logic to run the "detection" logic again and append_extracted
to all parsed labels.This PR changes the behavior: if parsed labels are returned by
SelectLogs
, the API does not try to be smart and to parse again, but just return structuredmetadata and parsed labels. Theparsers
returned in that case will be the parsers used in the query.