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

Combining WAI and Yesod instrumentation loses exception details

Open spencerjanssen opened this issue 8 months ago • 0 comments

I've got an application instrumented with both hs-opentelemetry-instrumentation-wai and hs-opentelemetry-instrumentation-yesod. For the most part this works well, however I've found that the details of exceptions (exception message, exception backtrace, span status message) thrown by handlers never make it to WAI middleware trace.

I see why this happens: by default Yesod catches the exception and converts it to an error page -- the WAI instrumentation never sees the exception. However, I'm not sure what the proper fix is. The Yesod middleware could simply recordException targeting the WAI trace. Unfortunately this still results in the WAI middleware setting a "" span status message rather than a meaningful description.

spencerjanssen avatar Nov 03 '23 20:11 spencerjanssen