-
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
Fix trace sdk builder 1393 #1471
Fix trace sdk builder 1393 #1471
Conversation
[Trace SDK] Implement builders (open-telemetry#1393)
Codecov Report
@@ Coverage Diff @@
## main #1471 +/- ##
=======================================
Coverage 84.73% 84.73%
=======================================
Files 155 155
Lines 4787 4787
=======================================
Hits 4056 4056
Misses 731 731 |
Fixed bazel build, clang-format.
Format cleanup.
Use std::unique_ptr instead of nostd::unique_ptr
Continued, implemented: - JaegerExporterFactory, - InMemorySpanExporterFactory, - RandomIdGeneratorFactory.
Added doc. Makefile format.
Misc cleanup.
(Last edit 2022-07-08) This PR is now ready for review. Remaining tasks:
Reviewers:
Regards, |
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.
Very nicely done. Thanks for the PR. Looks good with few (very) minor comments. Hope it would be fine to merge @owent 's async changes first :)
Implemented code review comments: - reworded docs/cpp-sdk-factory-design.md, - re organized includes, - added TracerContextFactory. Also: - renamed Build() methods to Create(), for consistency with HttpClientFactory::Create(), - added doxygen comments, - added CHANGELOG entry.
Thanks. The async changes have priority, I will deal with any merge conflict, these should be trivial to resolve anyway. One remaining point to discuss, that I am not sure of, is whether Factory classes should use:
@lalitb , @owent , @ThomsonTan , @esigo any input ? |
Or |
Conflicts: CHANGELOG.md exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h
Implement code review comments: - Factory methods should return a unique_ptr. - Used TracerContextFactory in examples.
Thanks, good point: a factory method should return a unique_ptr anyway. |
@owent Can you please review/approve it once you have time? Thanks :) |
Sorry for something else in company take my bandwidth. I will review this it in 2 or 3 days. |
Thanks. That should be fine :) |
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.
Could you please add a standalone unit test for OTLP exporters and ES exporters which only include factory headers and do not depend headers of protobuf? I think it's helpful to keep factory heads clean in the future.
Implement code review comments: - avoid copy of resource parameters (used const reference) - added unit tests to verify build sanity - moved JsonBytesMappingKind and HttpRequestContentType to their own header, to avoid the dependency on protobuf from otlp_http_client.h
Fixed makefiles.
Good idea, agreed. For the ES Log exporter, this will be done with the fix for issue #1486, as this change scope is for traces only. Added a unit test for the OTLP GRPC exporter factory, which was clean. Added a unit test for the OTLP HTTP exporter factory, which was broken. Fixed my moving some declarations from otlp_http_client.h to new file otlp_http.h, While at it, also made sure the OTLP HTTP exporter does not expose nlohmann/json. Thanks for the review. |
Unit test 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.
LGTM
@lalitb, @ThomsonTan Do not merge yet. It turns out the library name for the in memory exporter is visible externally after all,
Reverting un needed changes in |
CMake cleanup. Reverted the renaming of library opentelemetry_exporter_in_memory to opentelemetry_exporter_memory_trace. The name opentelemetry_exporter_in_memory is used externally, in cmake/opentelemetry-cpp-config.cmake.in
Format makefile.
@lalitb @ThomsonTan @owent Ok to merge for my part. |
Fixed grammar in documentation.
(Last edit 2022-07-12)
Fixes #1393
Fixes #1473
Changes
Implement Trace SDK builders, to avoid exposing SDK details to the application.
This is needed to deploy opentelemetry-cpp as a shared library.
Fixed memory ownership of
InMemorySpanExporter
in examples.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes