-
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: add _extracted suffix to detected fields conflicts #13993
feat: add _extracted suffix to detected fields conflicts #13993
Conversation
detected fields that conflict with indexed labels need the "extracted" suffix
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.
The parser will already add the suffix if it's part of the "base labels" passed to it:
https://github.com/grafana/loki/blob/main/pkg/logql/log/parser.go#L329
What if we just get all stream labels as LabelsBuilder
and pass that via parseLine
to the logFmtParser.Process
and jsonParser.Process
calls to let them handle adding the suffix?
I think that might be a bit better since adding the suffix would stay in one place.
this avoids an extra iteration over streams
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
What this PR does / why we need it:
Because the front end will pass field names directly from the
/detected_fields
call to asum by()
clause in the metric query, we need to differentiate fields that conflict with indexed labels by adding the "extracted" suffix