Skip to content

Commit 9947619

Browse files
authored
[EXPORTER] Add logging for async gRPC errors (#3108)
1 parent 751ba5b commit 9947619

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

exporters/otlp/src/otlp_grpc_client.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static sdk::common::ExportResult InternalDelegateAsyncExport(
207207
stub->experimental_async()
208208
# endif
209209
->Export(call_data->grpc_context.get(), call_data->request, call_data->response,
210-
[call_data, async_data](::grpc::Status grpc_status) {
210+
[call_data, async_data, export_data_name](::grpc::Status grpc_status) {
211211
--async_data->running_requests;
212212
++async_data->finished_request_counter;
213213

@@ -216,6 +216,13 @@ static sdk::common::ExportResult InternalDelegateAsyncExport(
216216
{
217217
call_data->export_result = opentelemetry::sdk::common::ExportResult::kSuccess;
218218
}
219+
else
220+
{
221+
OTEL_INTERNAL_LOG_ERROR("[OTLP GRPC Client] ERROR: Export "
222+
<< export_data_name << " failed with status_code: \""
223+
<< grpc_status.error_code() << "\" error_message: \""
224+
<< grpc_status.error_message() << "\"");
225+
}
219226

220227
if (call_data->grpc_async_callback)
221228
{

0 commit comments

Comments
 (0)