Airbrake Rust
*/!\ The project is in the alpha stage /!*
Introduction
Airbrake Rust is an Airbrake notifier library for the Rust Programming language. The library provides minimalist API that enables the ability to send Rust errors to the Airbrake dashboard.
Key features
- Uses the new Airbrake JSON API (v3)[link]
- Simple, consistent and easy-to-use library API[link]
- Awesome performance (check out our benchmarks)[link
- Asynchronous error reporting[link]
- Logging support via env_logger[link]
- Support for proxying[link]
- Support for environments[link]
- Filters support (filter out sensitive or unwanted data that shouldn't be sent)[link]
- Ability to ignore errors based on any condition[link]
- SSL support (all communication with Airbrake is encrypted by default)
Installation
Cargo
Add the crate to your Cargo.toml:
[]
= "0.2"
Examples
Basic example
This is the minimal example that you can use to test Airbrake Rust with your project:
extern crate airbrake;
use ParseIntError;
Configuration
project_key & project_id
You must set both project_id
& project_key
.
To find your project_id
and project_key
navigate to your project's General
Settings and copy the values from the right sidebar.
let mut airbrake = configure;
host
By default, it is set to https://airbrake.io
. A host
is a web address
containing a scheme ("http" or "https"), a host and a port. You can omit the
port (80 will be assumed).
let mut airbrake = configure;
workers
The number of threads that handle notice sending. The default value is 1.
let mut airbrake = configure;
proxy
If your server is not able to directly reach Airbrake, you can use proxy support. By default, Airbrake Rust uses direct connection. Note: proxy authentication is not supported yet.
let mut airbrake = configure;
app_version
The version of your application that you can pass to differentiate errors between multiple versions. It's not set by default.
let mut airbrake = configure;
API
airbrake
airbrake.notify
Sends an error to Airbrake asynchronously. error
must implement the
std::error::Error
trait. Returns ()
.
let mut airbrake = configure;
airbrake.notify;
airbrake.notify_sync
Sends an error to Airbrake synchronously. error
must implement the
std::error::Error
trait. Returns
rustc_serialize::json::Json
. Accepts the same
parameters as Airbrake.notify
.
let mut airbrake = configure;
airbrake.notify_sync;