Open
Description
Summary
Capture panics in OpenTelemetry-instrumented code and send errors to Sentry.
Motivation
At the moment people have to manually defer sentry.Recover()
or sentry.RecoverWithContext()
calls to catch panics.
For OpenTelemetry-instrumented code, panics are handled inside Span.End()
: https://github.com/open-telemetry/opentelemetry-go/blob/d68b05fbeecb0112da0b5614a78b0187a4a0ad7a/sdk/trace/span.go#L381-L398
So what we can do to access that error, is to inspect span events inside SentrySpanProcessor's OnEnd(), and then build and send a Sentry event.