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

feat: add _extracted suffix to detected fields conflicts #13993

Merged
merged 6 commits into from
Aug 29, 2024

Conversation

trevorwhitney
Copy link
Collaborator

What this PR does / why we need it:

Because the front end will pass field names directly from the /detected_fields call to a sum by() clause in the metric query, we need to differentiate fields that conflict with indexed labels by adding the "extracted" suffix

detected fields that conflict with indexed labels need the "extracted"
suffix
@trevorwhitney trevorwhitney requested a review from a team as a code owner August 28, 2024 17:28
Copy link
Contributor

@svennergr svennergr left a 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.

pkg/querier/querier.go Outdated Show resolved Hide resolved
Copy link
Contributor

@svennergr svennergr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@trevorwhitney trevorwhitney merged commit ab1caea into main Aug 29, 2024
60 checks passed
@trevorwhitney trevorwhitney deleted the add-extracted-to-conflicting-detected-fields branch August 29, 2024 16:36
pascal-sochacki pushed a commit to pascal-sochacki/loki that referenced this pull request Aug 29, 2024
pascal-sochacki pushed a commit to pascal-sochacki/loki that referenced this pull request Aug 29, 2024
pascal-sochacki pushed a commit to pascal-sochacki/loki that referenced this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants