Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set exception details when using WAI and Yesod instrumentation together #121

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pbrisbin
Copy link
Collaborator

@pbrisbin pbrisbin commented May 30, 2024

Address warnings and HLint

23743a3

Extract isInternalError

0d9cc2e

Set exception details when using WAI and Yesod instrumentation together

9610e0f

When the WAI instrumentation is used (so there is a span on the
request), this instrumentation only sets the shared attributes. Since
exceptions never reach WAI when used with Yesod (since they're caught to
error pages), this means that error traces don't include any details. By
calling recordException and setStatus here, we can address that.

Fixes #102

When the WAI instrumentation is used (so there is a span on the
request), this instrumentation only sets the shared attributes. Since
exceptions never reach WAI when used with Yesod (since they're caught to
error pages), this means that error traces don't include any details. By
calling `recordException` and `setStatus` here, we can address that.

Fixes iand675#102
@pbrisbin pbrisbin changed the title pb/wai yesod Set exception details when using WAI and Yesod instrumentation together May 30, 2024
@pbrisbin pbrisbin marked this pull request as ready for review May 30, 2024 14:44
@pbrisbin
Copy link
Collaborator Author

pbrisbin commented May 30, 2024

Regarding the pre-commit hook... When I run foumolu (the version in the in-use resolver), I get a configuration error:

% stack install --copy-compiler-tool fourmolu
Copying from
/home/patrick/.stack/snapshots/x86_64-linux-tinfo6/a76d5db647918a4cbcac406bf469be85d6333b9d6435f4dc08f2e0708720d750/9.2.7/bin/fourmolu
to /home/patrick/.stack/compiler-tools/x86_64-linux-tinfo6/ghc-9.2.7/bin/fourmolu.
Copied executables to /home/patrick/.stack/compiler-tools/x86_64-linux-tinfo6/ghc-9.2.7/bin/:
* fourmolu
% stack exec -- fourmolu --version
fourmolu 0.9.0.0 UNKNOWN UNKNOWN
using ghc-lib-parser 9.2.7.20230228
% stack exec -- fourmolu -i .
Failed to load /home/patrick/code/freckle/hs-opentelemetry/fourmolu.yaml:
Aeson exception:
Error in $['in-style']: unknown value: "no-space"
Valid values are: "left-align" or "right-align"


% 255 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combining WAI and Yesod instrumentation loses exception details
1 participant