opentelemetry-erlang-contrib/instrumentation/opentelemetry_phoenix/lib
Derek Kraan ddb2d3b963
Only attempt to record an exception if there is an active span. (#37)
There is an edge case, if you use `forward/4` and use Plug.ErrorHandler,
then when an exception reaches the outer router, then Plug.send_resp
will be called, triggering `[:phoenix, :endpoint, :stop]`, and the span
will be gone by the time the outer router gets the exception. This
causes this telemetry handler to crash and be detached.

Sequence of events:
- [:phoenix, :endpoint, :start]
- [:phoenix, :router_dispatch, :exception] (inner router)
- [:phoenix, :endpoint, :stop]
- [:phoenix, :router_dispatch, :exception] (outer router) ** here there is no span, crashes
2022-03-18 05:21:26 -06:00
..
opentelemetry_phoenix inspect terms that otherwise can't be serialized by exporter (#40) 2021-11-18 18:02:36 -07:00
opentelemetry_phoenix.ex Only attempt to record an exception if there is an active span. (#37) 2022-03-18 05:21:26 -06:00