-
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
[EXPORTER] Allow to share gRPC clients between OTLP exporters. #3041
base: main
Are you sure you want to change the base?
[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.12% 87.83% +0.72%
==========================================
Files 200 195 -5
Lines 6109 6146 +37
==========================================
+ Hits 5322 5398 +76
+ Misses 787 748 -39
|
✅ 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. |
exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h
Outdated
Show resolved
Hide resolved
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.
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.
Sorry for requesting change. This is for - #3041 (comment)
If we are agreeing to not being ABI compliant when using OTLP/gRPC exporter, it would be better to update our ABI document to reflect that as part of this PR. No concern as such with the implementation.
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. |
Fixes #3010
Changes
WITH_OTLP_GRPC
grpc::Channel
inOtlpGrpcClient
so 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 sameOtlpGrpcClient
and utilize the samegrpc::CompletionQueue
andgrpc::Channel
.When the exporters call
Shutdown
, theOtlpGrpcClient
will only callForceFlush
and will notShutdown
unless all the exporters using this client object are also shutdown.We can useOtlpGrpcClientFactory::Create()
to createOtlpGrpcClient
now, and then pass it toOtlpGrpcExporterFactory::Create()
,OtlpGrpcLogRecordExporterFactory::Create()
andOtlpGrpcMetricExporterFactory::Create()
, so all gRPC exporters created by these methods will share the sameOtlpGrpcClient
and use the samegrpc::CompletionQueue
andgrpc::Channel
.When the exporters call
Shutdown
, theOtlpGrpcClient
just callForceFlush
but do notShutdown
unless all the exporters use this client object are shutdown.Usage example:
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes