Sentry Rust SDK: sentry-actix
This crate adds a middleware for actix-web that captures errors and
report them to Sentry.
To use this middleware just configure Sentry and then add it to your actix web app as a middleware. Because actix is generally working with non sendable objects and highly concurrent this middleware creates a new Hub per request.
Example
use io;
use ;
async
Using Release Health
The actix middleware will automatically start a new session for each request
when auto_session_tracking is enabled and the client is configured to
use SessionMode::Request.
let _sentry = init;
Reusing the Hub
This integration will automatically create a new per-request Hub from the main Hub, and update the current Hub instance. For example, the following in the handler or in any of the subsequent middleware will capture a message in the current request's Hub:
capture_message;
It is recommended to register the Sentry middleware as the last, i.e. the first to be executed when processing a request, so that the rest of the processing will run with the correct Hub.
Resources
License: MIT