opentelemetry-erlang-contrib/instrumentation/opentelemetry_phoenix/test
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
..
support Update otel-phoenix deps (#9) 2021-09-19 17:51:51 -06:00
opentelemetry_phoenix_test.exs Only attempt to record an exception if there is an active span. (#37) 2022-03-18 05:21:26 -06:00
test_helper.exs Update otel-phoenix deps (#9) 2021-09-19 17:51:51 -06:00