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

See through more exception wrappers #43

Open
parsonsmatt opened this issue Nov 1, 2022 · 2 comments
Open

See through more exception wrappers #43

parsonsmatt opened this issue Nov 1, 2022 · 2 comments

Comments

@parsonsmatt
Copy link
Collaborator

Our Honeycomb query for exception types is a bit disappointing - the most common exception we deal with is AnnotatedException SomeException, seconded by SomeAsyncException. As a result, we don't get a lot of benefit from the exception type.

It'd be good to "dig through" the exception types and collect extra information on them. For example, instead of doing a mere SomeException inner, we can do something like:

case someException of
  SomeException inner 
    | Just (SomeAsyncException inner') <- cast inner
    -> -- now we can report a more interesting type

But there are a bunch of library defined wrappers, like unliftio's {As,S}yncExceptionWrapper, and AnnotatedException, and I'm sure more that we're not considering. So it may be good to consider a means of providing "unwrappers" that can dig through and add interesting stuff to an exception's type.

@iand675
Copy link
Owner

iand675 commented Nov 1, 2022

I love this idea. Let's make it happen.

@iand675
Copy link
Owner

iand675 commented Nov 1, 2022

I think the best place to support this would be in TracerProviderOptions, maybe something like:

data TracerProviderOptions = TracerProviderOptions
  { ...
  , traceProviderOptionsExceptionProcessors :: SomeException -> Maybe [(Text, Attribute)]`
  }

And then in recordException we'd use that option.

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

No branches or pull requests

2 participants