vaadin / observability-kit

Other
5 stars 2 forks source link

feat: instrumentation for ErrorHandler #92

Closed caalador closed 2 years ago

caalador commented 2 years ago

Instrument Errorhandler to catch any exceptions that are caught for requests.

Closes #80

sissbruecker commented 2 years ago

Marking the root span as an error instead of creating a separate error span makes definitely more sense.

However not marking the root span as an error in all cases can make some critical issues hard to discover. In the following case, I navigate to a view that then threw an exception in the constructor, in this case the root span does not get marked as an error:

Bildschirmfoto 2022-09-08 um 08 46 02

And this is what the user sees in the browser:

Bildschirmfoto 2022-09-08 um 08 46 13

As we discovered, unless the root span is marked as an error, it will not show up in the error reporting views of several vendors. I think this is an error that you would definitely expect to show up there.

sissbruecker commented 2 years ago

A semi related issue is that the same exception gets recorded multiple times. In this example, the exception is present on all 3 spans:

Bildschirmfoto 2022-09-08 um 08 55 21
caalador commented 2 years ago

Failing navigation in the constructor might be a corner case, but the multiple exceptions is there now also.