Skip to content

Commit

Permalink
Added sentry integration. (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius authored Mar 9, 2023
1 parent 890a198 commit f5e1792
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 0 deletions.
227 changes: 227 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ digest = "0.10.3"
mimalloc = { version = "~0.1.30", default-features = false }
clap = { version = "4.1.8", features = ["derive", "env"] }
dotenvy = { version = "0.15.6", features = ["clap"] }
sentry = "0.30.0"
sentry-actix = "0.30.0"

[dependencies.sha1]
version = "^0.10.1"
Expand Down
17 changes: 17 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,20 @@ pub struct NotificationsOptions {
pub hooks_file: Option<String>,
}

#[derive(Debug, Parser, Clone)]
pub struct SentryOptions {
#[arg(name = "sentry-dsn", long, env = "RUSTUS_SENTRY_DSN")]
pub dsn: Option<String>,

#[arg(
name = "sentry-sample-rate",
long,
default_value = "0.5",
env = "RUSTUS_SENTRY_SAMPLE_RATE"
)]
pub sample_rate: f32,
}

#[derive(Debug, Parser, Clone)]
#[command(name = "Rustus")]
/// Tus protocol implementation.
Expand Down Expand Up @@ -324,6 +338,9 @@ pub struct RustusConf {

#[command(flatten)]
pub notification_opts: NotificationsOptions,

#[command(flatten)]
pub sentry_opts: SentryOptions,
}

#[cfg_attr(coverage, no_coverage)]
Expand Down
Loading

0 comments on commit f5e1792

Please sign in to comment.