opentelemetry-erlang icon indicating copy to clipboard operation
opentelemetry-erlang copied to clipboard

with_span doesn't call record_exception

Open garthk opened this issue 3 years ago • 2 comments

I'd expect with_span to catch errors/exceptions, call record_exception, set the span status, and then re-raise like it did in OpenCensus.Elixir. I can't see it happening, though, nor find any mechanism for it.

In the OT world, adding events for exceptions is the default for Python, though they also provide record_exception and set_status_on_exception as start options on their start_span so users can opt out. (Note it returns a context manager, so Python's with start_span(…): is equivalent to our with_span.)

garthk avatar Mar 26 '21 02:03 garthk

Only just noticed: record_exception is Elixir-side-only.

garthk avatar Mar 26 '21 03:03 garthk

Experiment adding OT Python style opt-out record_exception and set_status_on_exception start options on with_span/4: https://gist.github.com/garthk/fddffdb2880b665c296cab435f216267

garthk avatar Mar 27 '21 05:03 garthk