GlitchTip is an open-source alternative to Sentry that works seamlessly with the Sentry Rust SDK.
cargo add sentry
Add the following code to your main.rs (or where relevant to run as soon as possible)
let _guard = sentry::init("YOUR-GLITCHTIP-DSN-HERE");
The quickest way to verify Sentry in your Rust application is to cause a panic:
fn main() {
let _guard = sentry::init("YOUR-GLITCHTIP-DSN-HERE");
// GlitchTip will capture this
panic!("Oh no, an error!");
}
The Rust SDK accepts various configuration options. Here's an example that sets the release name.
let _guard = sentry::init((
"YOUR-GLITCHTIP-DSN-HERE",
sentry::ClientOptions {
release: sentry::release_name!(),
..Default::default()
},
));