rocket-sentry 0.1.0

Simple add-on for the Rocket web framework to simplify integration with the Sentry application monitoring system.
Documentation

Rocket Sentry

rocket-sentry is a simple add-on for the Rocket web framework to simplify integration with the Sentry application monitoring system.

Or maybe...

"The Rocket Sentry is a static rocket-firing gun platform that is based on a Personality Construct and used in the Aperture Science Enrichment Center."

-- Half-Life wiki

Features

Currently, rocket-sentry only enables the Rust panic handler.

rocket-sentry can be configured via Rocket.toml (sentry_dsn=) or environment variable ROCKET_SENTRY_DSN.

Usage

To use this, add the dependency to your Cargo.toml, and add the following to your code:

use rocket_sentry::RocketSentry;

fn main() {
    rocket::ignite()
        .attach(RocketSentry::fairing())
        // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        .launch();
}

Then, the Sentry integration can be enabled by adding a sentry_dsn= value to the Rocket.toml file, for example:

[development]
sentry_dsn = ""  # Disabled
[staging]
sentry_dsn = "https://057006d7dfe5fff0fbed461cfca5f757@sentry.io/1111111"
[production]
sentry_dsn = "https://057006d7dfe5fff0fbed461cfca5f757@sentry.io/1111111"

Testing

The functionality can be tested with the "example" sub-project. Just change the example/Rocket.toml file and run it...

cd example
rustup override set nightly
cargo run

Then try accessing this URL: http://localhost:8012/panic?msg=Everything%20is%20on%20fire%21