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
LogContext: Fix a bug where multiple logs with similar nanosecond timestamps were loaded too often #71319
Conversation
e892539
to
9d0bf5d
Compare
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 👍
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-71319-to-v10.0.x origin/v10.0.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 212239aedbabacdca2309feedbda2dc72d88ddb5
# When the conflicts are resolved, stage and commit the changes
git add . && git cherry-pick --continue If you have the GitHub CLI installed: # Create the PR body template
gh pr view 71319 --json body --template 'Backport 212239aedbabacdca2309feedbda2dc72d88ddb5 from #71319{{ "\n\n---\n\n" }}{{ index . "body" }}' > .pr-body.txt
# Push the branch to GitHub and a PR
gh pr create --title "[v10.0.x] LogContext: Fix a bug where multiple logs with similar nanosecond timestamps were loaded too often" --body-file .pr-body.txt --label "type/bug" --label "area/frontend" --label "add to changelog" --label "area/logs" --label "backport" --base v10.0.x --milestone 10.0.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # If you don't have the GitHub CLI installed: Push the branch to GitHub and manually create a PR:
git push --set-upstream origin backport-71319-to-v10.0.x
# Remove the local backport branch
git switch main
git branch -D backport-71319-to-v10.0.x Unless you've used the GitHub CLI above, now create a pull request where the |
…estamps were loaded too often (#71319) fix bug with multiple ns logs
…estamps were loaded too often (#71319) fix bug with multiple ns logs
What is this feature?
In some occasions and due to the fact that requests in Grafana are based on miliseconds, Loki will return the same log liens as already present in the LogContext component. For such cases it is not enough to only compare the ref-logline but we would need to filter out all logs that are already present.
Special notes for your reviewer:
data.js
change after review, but that should help you create the edge case.{place="moon",time="ns"} | line_format "{{__timestamp__}}"
Without the fix:
Screen.Recording.2023-07-11.at.07.41.29.mov
With the fix:
Screen.Recording.2023-07-11.at.07.42.38.mov