Hubs/Scopes Merge 28 - Fix breadcrumb ordering#3355
Merged
Conversation
…pes-merge-2-add-scopes
…ainScopes to rootScopes
Contributor
|
7 tasks
markushi
approved these changes
Apr 19, 2024
lbloder
reviewed
Apr 22, 2024
| public int compareTo(@NotNull Breadcrumb o) { | ||
| // TODO also use nano time if equal | ||
| return timestamp.compareTo(o.timestamp); | ||
| int timestampCompare = timestamp.compareTo(o.timestamp); |
Collaborator
There was a problem hiding this comment.
In order to have consistent ordering, should we always use nanos?
We would also have to change the constructor to take a nano time.
Member
Author
There was a problem hiding this comment.
Yeah makes sense, e.g. for OTEL where we likely have to create breadcrumbs after the fact. Will change it to only use nanos in a follow up PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#skip-changelog
📜 Description
Use
System.nanoTime()to have a more detailed timestamp for ordering breadcrumbs.The actual value shouldn't matter too much as breadcrumbs should be created / deserialized in order and
nanosare only used iftimestampis the same.💡 Motivation and Context
To have better ordering of breadcrumbs and avoid random order when timestamp is equal. This also caused flaky tests.
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps