Rocket Sentry

Crates.io version Documentation Tests status

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 is very basic, it only enables the Rust panic handler. There is no integration with the Rocket request lifecycle. Pull requests welcome!

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 fairing to your code:

```rust use rocket_sentry::RocketSentry;

[launch]

fn rocket() -> _ { rocket::build() .attach(RocketSentry::fairing()) // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ add this line } ```

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

toml [debug] sentry_dsn = "" # Disabled [release] sentry_dsn = "https://057006d7dfe5fff0fbed461cfca5f757@sentry.io/1111111"

Testing

The functionality can be tested with the examples/panic.rs example. Just change the Rocket.toml file and run it...

shell script cargo run --example panic

Then try accessing this URL: http://localhost:8012/panic?msg=Is+it+time+to+panic+yet?

Release history

0.13.0 (2022-11-08)
0.12.0 (2022-09-30)
0.11.0 (2022-05-22)
0.10.0 (2022-03-26)
0.9.0 (2022-01-22)
0.8.0 (2021-11-22)
0.7.0 (2021-07-13)
0.6.0 (2021-01-26)
0.5.0 (2020-09-15)
0.4.0 (2020-08-16)
0.3.0 (2020-07-22)
0.2.0 (2020-04-04)
0.1.0 (2019-11-25)