-
Notifications
You must be signed in to change notification settings - Fork 1.2k
sdk/log: Deduplicate key-value collections in Record.SetBody #7002
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
Open
Mojachieee
wants to merge
14
commits into
open-telemetry:main
Choose a base branch
from
Mojachieee:dedup-keyvals-in-log-body
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+103
−5
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ee35e14
add test cases for keyvalue collections with duplicates in log body
Mojachieee 6d291b2
update SetBody to deduplicate keyvalue collections
Mojachieee 642daca
refactor dedupeandlimit func into separate funcs
Mojachieee d09263a
lint
Mojachieee 319c086
fix allowDuplicates bug and add test
Mojachieee 07d610f
changelog
Mojachieee 3e64aa9
fix dedupe body using wrong function, update changelog
Mojachieee efc658a
Update CHANGELOG.md
pellared 0c54eab
Apply suggestions from code review
Mojachieee fbade72
Update sdk/log/record_test.go
pellared 5acf33a
Merge branch 'main' into dedup-keyvals-in-log-body
pellared 80f0893
lint
Mojachieee e9bd161
Merge branch 'main' into dedup-keyvals-in-log-body
pellared 4df978d
Merge branch 'main' into dedup-keyvals-in-log-body
pellared File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
What affect does this have on the performance of
SetBody
?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.
At this point of time we should do the deduplication anyway (to be compliant with the specification).
The performance benefit of not doing (when
allowDupKeys
istrue
) it is pretty irrelevant given we will remove this opt-in performance optimization probably inv1.39.0
. Therefore, I do not think it is worth adding a new benchmark. More here: #7002 (comment)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.
This should likely be done in a lazy manner. Having performance information about the approach presented here will provide evidence to how critical that work is going to be.
Uh oh!
There was an error while loading. Please reload this page.
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.
We have benchmarks for the same on log record attributes: #6968 (comment) this is also why I thought that maybe we do not more 😉
However, I think it would be easier and less-controversial to just add benchmarks for
Record.SetBody
.@Mojachieee, can you add them and add the results to the PR description?
Uh oh!
There was an error while loading. Please reload this page.
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.
@Mojachieee, are you able to address the comment?
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.
Yep, I hope to get to it this week