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

[v10.2.x] Loki: Fix bug duplicating parsed labels across multiple log lines #80368

Merged
merged 1 commit into from Jan 11, 2024

Conversation

grafana-delivery-bot[bot]
Copy link
Contributor

Backport e1aa8a9 from #80292


What is this feature?

With the addition of the categorization of labels we were mutating the "main" labels object and adding parsed labels per logline to that object. Instead we needed to copy the indexed labels for each log line. This PR adds a fix and test cases.

Special notes for your reviewer:

  1. Start Grafana and the Loki devenv

  2. Do a query like {place="luna"} |logfmt| line_format "label{{ .label }}={{ unixEpochMillis now }}" | logfmt

  3. Without the fix you should see log lines like this:
    image
    And when opening the details you will see duplicated labels, e.g. labelval1 and labelval3 eventhough the logline does only contain one of the labels.
    image

  4. With the fix you will only see the label from that one log line.

@svennergr svennergr enabled auto-merge (squash) January 11, 2024 14:12
@svennergr svennergr merged commit 4c64aa6 into v10.2.x Jan 11, 2024
22 checks passed
@svennergr svennergr deleted the backport-80292-to-v10.2.x branch January 11, 2024 14:22
@zserge zserge modified the milestones: 10.2.x, 10.2.4 Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants