Skip to content

Commit 829294e

Browse files
authored
Merge branch 'main' into allow_construct_grpc_exporters_with_existed_grpc_client
2 parents 3ff6e4b + 9947619 commit 829294e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

exporters/otlp/src/otlp_grpc_client.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,13 @@ static sdk::common::ExportResult InternalDelegateAsyncExport(
219219
stub->experimental_async()
220220
# endif
221221
->Export(call_data->grpc_context.get(), call_data->request, call_data->response,
222-
[call_data, async_data](::grpc::Status grpc_status) {
222+
[call_data, async_data, export_data_name](::grpc::Status grpc_status) {
223223
{
224224
std::lock_guard<std::mutex> lock{async_data->running_calls_lock};
225225
async_data->running_calls.erase(
226226
std::static_pointer_cast<OtlpGrpcAsyncCallDataBase>(call_data));
227227
}
228+
228229
--async_data->running_requests;
229230
++async_data->finished_request_counter;
230231

@@ -233,6 +234,13 @@ static sdk::common::ExportResult InternalDelegateAsyncExport(
233234
{
234235
call_data->export_result = opentelemetry::sdk::common::ExportResult::kSuccess;
235236
}
237+
else
238+
{
239+
OTEL_INTERNAL_LOG_ERROR("[OTLP GRPC Client] ERROR: Export "
240+
<< export_data_name << " failed with status_code: \""
241+
<< grpc_status.error_code() << "\" error_message: \""
242+
<< grpc_status.error_message() << "\"");
243+
}
236244

237245
if (call_data->grpc_async_callback)
238246
{

0 commit comments

Comments
 (0)