File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed
Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ Increment the:
2121* [ REMOVAL] Remove build option ` WITH_DEPRECATED_SDK_FACTORY `
2222 [ #2717 ] ( https://github.com/open-telemetry/opentelemetry-cpp/pull/2717 )
2323
24+ * [ EXPORTER] Allow to share gRPC clients between OTLP exporters.
25+ [ #3041 ] ( https://github.com/open-telemetry/opentelemetry-cpp/pull/3041 )
26+
2427Breaking changes:
2528
2629* [ REMOVAL] Remove build option ` WITH_DEPRECATED_SDK_FACTORY `
Original file line number Diff line number Diff line change @@ -94,8 +94,12 @@ std::unique_ptr<sdk::trace::Recordable> OtlpGrpcExporter::MakeRecordable() noexc
9494sdk::common::ExportResult OtlpGrpcExporter::Export (
9595 const nostd::span<std::unique_ptr<sdk::trace::Recordable>> &spans) noexcept
9696{
97+ #ifdef ENABLE_ASYNC_EXPORT
9798 nostd::shared_ptr<OtlpGrpcClient> client = client_;
9899 if (isShutdown () || !client)
100+ #else
101+ if (isShutdown ())
102+ #endif
99103 {
100104 OTEL_INTERNAL_LOG_ERROR (" [OTLP gRPC] Exporting " << spans.size ()
101105 << " span(s) failed, exporter is shutdown" );
Original file line number Diff line number Diff line change @@ -108,8 +108,12 @@ OtlpGrpcLogRecordExporter::MakeRecordable() noexcept
108108opentelemetry::sdk::common::ExportResult OtlpGrpcLogRecordExporter::Export (
109109 const nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>> &logs) noexcept
110110{
111+ #ifdef ENABLE_ASYNC_EXPORT
111112 nostd::shared_ptr<OtlpGrpcClient> client = client_;
112113 if (isShutdown () || !client)
114+ #else
115+ if (isShutdown ())
116+ #endif
113117 {
114118 OTEL_INTERNAL_LOG_ERROR (" [OTLP gRPC log] Exporting " << logs.size ()
115119 << " log(s) failed, exporter is shutdown" );
Original file line number Diff line number Diff line change @@ -98,8 +98,12 @@ sdk::metrics::AggregationTemporality OtlpGrpcMetricExporter::GetAggregationTempo
9898opentelemetry::sdk::common::ExportResult OtlpGrpcMetricExporter::Export (
9999 const opentelemetry::sdk::metrics::ResourceMetrics &data) noexcept
100100{
101+ #ifdef ENABLE_ASYNC_EXPORT
101102 nostd::shared_ptr<OtlpGrpcClient> client = client_;
102103 if (isShutdown () || !client)
104+ #else
105+ if (isShutdown ())
106+ #endif
103107 {
104108 OTEL_INTERNAL_LOG_ERROR (" [OTLP METRICS gRPC] Exporting "
105109 << data.scope_metric_data_ .size ()
You can’t perform that action at this time.
0 commit comments