-
Notifications
You must be signed in to change notification settings - Fork 555
fix: Improved logging for OTLP Tonic Exporter #3108
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
base: main
Are you sure you want to change the base?
Changes from all commits
ee0d2bc
0667dfb
9ad29b6
24c7fe2
65fab08
b08f658
3d7e6b9
b134382
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,15 @@ impl LogExporter for TonicLogsClient { | |
let (m, e, _) = inner | ||
.interceptor | ||
.call(Request::new(())) | ||
.map_err(|e| OTelSdkError::InternalFailure(format!("error: {e:?}")))? | ||
.map_err(|e| { | ||
otel_debug!( | ||
name: "TonicLogsClient.InterceptorFailed", | ||
grpc_code = format!("{:?}", e.code()), | ||
grpc_message = e.message(), | ||
grpc_details = format!("{:?}", e.details()) | ||
cijothomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
); | ||
OTelSdkError::InternalFailure("Logs export failed in interceptor".into()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we at least add the grpc_code here ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. neutral to it..we already log it here. And upstream SDK would log again... I can add just the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, add TODO to do selective error handling - i.e. return detailed info for non-auth errors |
||
})? | ||
.into_parts(); | ||
(inner.client.clone(), m, e) | ||
} | ||
|
@@ -88,9 +96,13 @@ impl LogExporter for TonicLogsClient { | |
Ok(()) | ||
} | ||
Err(e) => { | ||
let error = format!("export error: {e:?}"); | ||
otel_debug!(name: "TonicLogsClient.ExportFailed", error = &error); | ||
Err(OTelSdkError::InternalFailure(error)) | ||
otel_debug!( | ||
name: "TonicLogsClient.ExportFailed", | ||
grpc_code = format!("{:?}", e.code()), | ||
cijothomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
grpc_message = e.message(), | ||
grpc_details = format!("{:?}", e.details()) | ||
cijothomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
); | ||
Err(OTelSdkError::InternalFailure("Logs export failed".into())) | ||
} | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.