-
Notifications
You must be signed in to change notification settings - Fork 86
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
Emit the error code and type to the tracing span for inbound calls #903
Emit the error code and type to the tracing span for inbound calls #903
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev #903 +/- ##
==========================================
+ Coverage 88.78% 88.89% +0.10%
==========================================
Files 43 43
Lines 4440 4510 +70
==========================================
+ Hits 3942 4009 +67
Misses 379 379
- Partials 119 122 +3
☔ View full report in Codecov by Sentry. |
errorType := appErrorType | ||
if response.systemError { | ||
errorType = systemErrorType | ||
// if the error is a system error, set the error code in span log | ||
span.SetTag("rpc.tchannel.system_error_code", GetSystemErrorCode(response.err)) | ||
} | ||
span.SetTag("rpc.tchannel.error_type", errorType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel something like this could be easier to read:
(Also - we can add the error message to the span log)
if span := response.span; span != nil {
if response.systemError {
ext.Error.Set(span, true)
span.SetTag("rpc.tchannel.error_type", "system")
span.SetTag("rpc.tchannel.system.error_code", GetSystemErrorCode(response.err))
span.LogKV("rpc.tchannel.system.error_message", GetSystemErrorMessage(response.err))
} else if response.applicationError {
ext.Error.Set(span, true)
span.SetTag("rpc.tchannel.error_type", "application")
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for coming late to this. why weren't these changes tested?
Changelog
Description
This change adds the error type and code (for system errors) to the tracing spans for inbound requests.