-
Notifications
You must be signed in to change notification settings - Fork 423
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
Fix log sdk builder (#1486) #1524
Fix log sdk builder (#1486) #1524
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1524 +/- ##
==========================================
+ Coverage 84.59% 84.65% +0.07%
==========================================
Files 156 156
Lines 4794 4794
==========================================
+ Hits 4055 4058 +3
+ Misses 739 736 -3
|
Fixed bazel build. Added CHANGELOG entry.
Code cleanup
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.
Just want to discuss, do we need a standalone factor for every processor?Or it's more simple to use just one factory to create different type of process and all return std::unique_ptr<LogProcessor>
?
I don't have strong preference for either approach - both looks good. |
Implemented code review comments. Fixed typo (processor -> processors) in TracerContextFactory
@owent , @lalitb Good question, as it is another possible design. Assuming something like:
there is only one class, with builders for each flavor of log processor. This design works here for log processor, but does not for other cases. For example applying the same pattern to trace exporters, it leads to:
Because of this class, there is no longer a way to link only a few exporters the application owner wants in the final binary. Instead, every exporter has to be linked in the final application, which is not good. So, to avoid confusion for the user of this code, the design here sticks to always the same pattern, To get a instance of class XXX, call XXXFactory::Create() The XXXFactory class is provided in the same library as class XXX, which makes it possible to use XXX but not YYY. |
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, Could you please also add a standalone unit test so that we can ensure factory headers of OTLP exporters do not include any protobuf header?
Agree, the current approach looks good. |
Implemented code review comments, added unit tests.
Indeed, I should have known from traces. Thanks, unit test added. |
Fixed build break.
@owent - Can you approve the changes if the recent unit tests look good? Thanks. |
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
Fixes #1486
Changes
Implement builders for log SDK.
CHANGELOG.md
updated for non-trivial changes