-
Notifications
You must be signed in to change notification settings - Fork 417
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
[SDK] support for the new OTel log API #2123
Merged
ThomsonTan
merged 20 commits into
open-telemetry:main
from
ThomsonTan:otel_cpp_log_sdk_impl
May 6, 2023
Merged
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ba48a1a
Add event name setter to log record
ThomsonTan 35f4d3e
Support EventId in SDK logger
ThomsonTan 08df24a
Merge branch 'main' into otel_cpp_log_sdk_impl
ThomsonTan 9e4ef59
Merge branch 'main' into otel_cpp_log_sdk_impl
ThomsonTan 976dc15
Add implementation for derived classes of Recordable
ThomsonTan 8dab553
Override SetEventId for ElasticLogRecord
ThomsonTan 4f438c4
Merge branch 'main' into otel_cpp_log_sdk_impl
ThomsonTan df51baa
Comment out unused parameter name
ThomsonTan 2c97fa5
Fix more unused parameters warning
ThomsonTan 242e364
Fix warning
ThomsonTan 8b7785e
Avoid passing raw event Id as integer to SDK
ThomsonTan 818cf6b
Initialize EventId in ReadWriteLogRecordable
ThomsonTan 7e5d7fc
Remove unnecesssary init
ThomsonTan afac98b
Fix MD034 - Bare URL used
ThomsonTan 3a40fc6
Fix CI
ThomsonTan 79b6729
Update changelog
ThomsonTan cdf64f5
Implement SetEventId for multi_recordable
ThomsonTan 63eff3f
Merge branch 'main' into otel_cpp_log_sdk_impl
ThomsonTan 0fd54b2
Merge branch 'main' into otel_cpp_log_sdk_impl
ThomsonTan 04e6dcd
Add integration test with user facing Log API call
ThomsonTan 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 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 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 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 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 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 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 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 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 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 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 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 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 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
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.
Is it conflicted with Body?Log body can also be converted from
int64_t
implicitly.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.
Yes, thanks for the catch. Seems the template part of filling logging record requires each parameter to be in different type, and the
any
type on body make it conflict with other parameters. Do you have any suggestion for this problem?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.
I have no idea for this problem by now, and I only avoided to specialize templates for these types before.
Maybe we can add a unit test to check the mistake.
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.
I removed the passing of int64_t to SDK, instead, a temporary EventId struct will be constructed which should fix the issue.
For unittest, do you mean to cover all the variant types of
body
field?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.
Yes, use EmitLogRecord to cover all the variant types of body field.
Maybe we can also add it in another PR 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.
FYI, I added an integration test to cover if the EventId passed to the user-facing API is passed correctly to the SDK.
https://github.com/ThomsonTan/opentelemetry-cpp/blob/otel_cpp_log_sdk_impl/exporters/ostream/test/ostream_log_test.cc#L465