Skip to content

Commit

Permalink
Fix OTLP HTTP exporting in sync mode. (#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
owent authored Jun 13, 2023
1 parent 4b20067 commit fc8853e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions exporters/otlp/src/otlp_http_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -712,12 +712,13 @@ OtlpHttpClient::OtlpHttpClient(OtlpHttpClientOptions &&options,
opentelemetry::sdk::common::ExportResult OtlpHttpClient::Export(
const google::protobuf::Message &message) noexcept
{
opentelemetry::sdk::common::ExportResult session_result =
opentelemetry::sdk::common::ExportResult::kSuccess;
std::shared_ptr<opentelemetry::sdk::common::ExportResult> session_result =
std::make_shared<opentelemetry::sdk::common::ExportResult>(
opentelemetry::sdk::common::ExportResult::kSuccess);
opentelemetry::sdk::common::ExportResult export_result = Export(
message,
[&session_result](opentelemetry::sdk::common::ExportResult result) {
session_result = result;
[session_result](opentelemetry::sdk::common::ExportResult result) {
*session_result = result;
return result == opentelemetry::sdk::common::ExportResult::kSuccess;
},
0);
Expand All @@ -727,7 +728,7 @@ opentelemetry::sdk::common::ExportResult OtlpHttpClient::Export(
return export_result;
}

return session_result;
return *session_result;
}

sdk::common::ExportResult OtlpHttpClient::Export(
Expand Down

0 comments on commit fc8853e

Please sign in to comment.