datarouter-exception is a tool to monitor and view exceptions
<dependency>
<groupId>io.datarouter</groupId>
<artifactId>datarouter-exception</artifactId>
<version>0.0.126</version>
</dependency>
You can install this module by adding its plugin to the WebappBuilder
.
.addPlugin(new DatarouterExceptionPluginBuilder(...)
.build()
Exceptions are recorded with the ExceptionRecorder
, which is heavily used throughout datarouter. ExceptionRecorder
can be used anywhere, and is automatically added for all jobs and handlers. Each time an exception occurs it's logged
and saved in the ExceptionRecord
table with a TTL of 2 weeks.
The ExceptionHandlingFilter
catches exceptions for http requests and saves them in the HttpRequestRecord
table with
the associated exception id.
All the exceptions that are caught are aggregated by exception type and location over the last hour and saved in the
ExceptionRecordSummary
table. The summaries are displayed in the "Browse Exceptions" page on the datatrouter UI.
Each summary shows the following, sorted by count.
Type
- The type of exceptionLocation
- Where the exception occurredIssue
(editable) - A tracking number for third party services like JIRACount
- The number of summaries exceptions with the same type and locationMute
(editable) - If the summary has been muted or not.Details
- View the exception details. This could be any exception record with the same type and location.
You can view the details of any exception by searching for the exceptionRecordId or clicking on the details link from the BrowseExceptions page.
The details page shows all the data collected for the specified exception:
- Server Name
- Code Version
- Stack Trace
- Location (class canonical name)
- Call origin
If there is an associated http request with the exception, than a record is saved in the HttpRequestRecord table and the following is also displayed on the details page.
- Request url
- Parameters
- Body
Client options
- Client Ip address
- Cookies
- Header
Datarouter provides an option to configure the handling and recording of exceptions. The default implementations are
DefaultExceptionHandlingConfig
and DefaultExceptionRecorder
but can be overridden in the PluginBuilder.
Exceptions can also be posted to third party services with an implementation of the ExceptionRecordPublisher
and
adding enablePublishing(...)
to the PluginBuilder.
This library is licensed under the Apache License, Version 2.0 - see LICENSE for details.