Open
Description
Why
document that End should handle recording exceptions for panics.
I think that documenting that
span.End
should handle recording exceptions for panics is a good idea.In my opinion, this is how we implement recording an exception in the most possible user-friendly way.
Originally posted by @pellared in #7254
What
Document that
opentelemetry-go/trace/span.go
Lines 28 to 32 in cba6502
should also record an unhandled panic and set status to Error.
In order to follow https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/exceptions.md#recording-an-exception, then here
opentelemetry-go/sdk/trace/span.go
Lines 465 to 482 in bc531cb
we also should
- set span status to
Error
with a description - set error.type attribute (semconv: Add ErrorType function #6904)