-
Notifications
You must be signed in to change notification settings - Fork 512
[EXPORTER] Allow to share gRPC clients between OTLP exporters #3041
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
[EXPORTER] Allow to share gRPC clients between OTLP exporters #3041
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3041 +/- ##
=======================================
Coverage 87.83% 87.83%
=======================================
Files 195 195
Lines 6146 6146
=======================================
Hits 5398 5398
Misses 748 748
|
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
|
Is there any change to include this PR into next release? |
Hi @owent. Going though the code review, and I would like to include it in the next release as well. In the PR description, there are two descriptions for "In async mode, ..." but none for the sync mode. Could you revise the text for clarity, I assume you wanted two sections, one for sync and one for async. |
I think this is now resolved by the latest changes in internal abseil, by @owent. Using the OTLP GRPC exporter requires external abseil, which no longer forces the API to use abseil, and therefore does not change the ABI for Let's discuss technical details in the team meeting. |
…exporters_with_existed_grpc_client
Yes, the issue is resolved by making the internal Abseil-CPP namespace non-inline. |
|
Ping @lalitb . Issue with ABSEIL and ABI is resolved, please take another look. |
lalitb
left a 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.
Removing the change requested, as both the concerns - using external abseil for nostd, and use of nostd constructs in sdk - have been resolved. Thanks for fixing this.
[EXPORTER] Allow to share gRPC clients between OTLP exporters (open-telemetry#3041)
|
There is a typo -> |
Fixes #3010
Changes
WITH_OTLP_GRPCgrpc::ChannelinOtlpGrpcClientso we can share it between multiple exporters.We can use
OtlpGrpcClientFactory::Create()to create anOtlpGrpcClient. This client can then be passed toOtlpGrpcExporterFactory::Create(),OtlpGrpcLogRecordExporterFactory::Create(), andOtlpGrpcMetricExporterFactory::Create(). By doing this, all gRPC exporters created by these methods will share the sameOtlpGrpcClientand utilize the samegrpc::CompletionQueueandgrpc::Channel.When the exporters call
Shutdown, theOtlpGrpcClientwill only callForceFlushand will notShutdownunless all the exporters using this client object are also shutdown.We can useOtlpGrpcClientFactory::Create()to createOtlpGrpcClientnow, and then pass it toOtlpGrpcExporterFactory::Create(),OtlpGrpcLogRecordExporterFactory::Create()andOtlpGrpcMetricExporterFactory::Create(), so all gRPC exporters created by these methods will share the sameOtlpGrpcClientand use the samegrpc::CompletionQueueandgrpc::Channel.When the exporters call
Shutdown, theOtlpGrpcClientjust callForceFlushbut do notShutdownunless all the exporters use this client object are shutdown.Usage example:
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes