-
Notifications
You must be signed in to change notification settings - Fork 667
Always set error type and record error in otelhttp transport #7456
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7456 +/- ##
=====================================
Coverage 82.3% 82.3%
=====================================
Files 205 205
Lines 17967 17962 -5
=====================================
- Hits 14794 14792 -2
+ Misses 2736 2734 -2
+ Partials 437 436 -1
🚀 New features to boost your workflow:
|
} | ||
|
||
span.SetAttributes(t.semconv.ErrorType(err)) | ||
span.RecordError(err) |
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.
What is the value of recording the error as event if the type is set as attribute and value (err.Error()
) as status description?
An exception SHOULD be recorded as an Event on the span during which it occurred if and only if it remains unhandled when the span ends and causes the span status to be set to ERROR.
I argue that error result is not an exception. For me a panic
that was not being recovered is an unhandled exception. We already cover this part of this specification here:
Additionally see: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/recording-errors.md#recording-errors-on-spans
Therefore, we should not call span.RecordError(err)
.
span.RecordError(err) |
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.
Do you want to chime in #7254?
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.
Closing per the comment discussion. |
Closes #7254