#rocket #fairing #sentry #monitoring #error-reporting

rocket-sentry

Simplifies integration between the Rocket web framework and Sentry application monitoring system

14 breaking releases

0.15.0 Feb 25, 2023
0.13.0 Nov 7, 2022
0.11.0 May 22, 2022
0.10.0 Mar 26, 2022
0.1.0 Nov 24, 2019

#617 in Web programming

Download history 120/week @ 2022-11-27 151/week @ 2022-12-04 33/week @ 2022-12-11 28/week @ 2022-12-18 29/week @ 2022-12-25 39/week @ 2023-01-01 76/week @ 2023-01-08 61/week @ 2023-01-15 117/week @ 2023-01-22 46/week @ 2023-01-29 50/week @ 2023-02-05 156/week @ 2023-02-12 168/week @ 2023-02-19 113/week @ 2023-02-26 79/week @ 2023-03-05 82/week @ 2023-03-12

446 downloads per month

MIT license

20KB
65 lines

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:

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:

[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...

cargo run --example panic

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

Release history

0.15.0 (2023-02-25)
  • Update Rust crate sentry to 0.30.0 (#55)
0.14.0 (2023-01-08)
  • Update Rust crate sentry to 0.29.1 (#53)
0.13.0 (2022-11-08)
  • Update Rust crate sentry to 0.28.0 (#51)
0.12.0 (2022-09-30)
  • Update Rust crate sentry to 0.27.0 (#44)
  • Log a message when Sentry events are sent (#48)
0.11.0 (2022-05-22)
  • Update Rust crate sentry to 0.26.0 (#42)
  • Update Rust crate rocket to 0.5.0-rc.2 (#39)
  • Update to use Rust 2021 edition (#41)
  • Fixed CI (#40)
  • Patch version updates
0.10.0 (2022-03-26)
  • Update Rust crate sentry to 0.25.0 (#31) & patch version updates
0.9.0 (2022-01-22)
  • Update Rust crate sentry to 0.24.1 (#28) & patch version updates
0.8.0 (2021-11-22)
  • Breaking change: Update to Rocket version 0.5-rc
    • To continue using Rocket 0.4.x, stay with rocket-sentry 0.7.0
    • Now using figment and serde for configuration (as required by Rocket)
    • The fairing no longer needs to have Response kind
    • RocketSentry now uses fairing kind Singleton
0.7.0 (2021-07-13)
  • Update sentry requirement from 0.22 to 0.23 (#20)
0.6.0 (2021-01-26)
  • Update sentry requirement from 0.20 to 0.22 (#16)
0.5.0 (2020-09-15)
  • Update sentry requirement from 0.19 to 0.20 (#13)
0.4.0 (2020-08-16)
  • Use log crate instead of println (#11). Thanks to Afonso Bordado, @afonso360
0.3.0 (2020-07-22)
  • Update sentry requirement from 0.18.0 to 0.19.0 (#9)
    • Sentry now automatically installs panic handler, dropped from rocket-sentry.
0.2.0 (2020-04-04)
  • Update sentry requirement from 0.12.0 to 0.18.0 (#1)
  • Add CI builds and basic test case (#3, #4)
  • Add documentation for Rust doc (#5)
0.1.0 (2019-11-25)
  • Initial release

Dependencies

~15–49MB
~1M SLoC