mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-28 14:36:51 +00:00
Bypass SENTRY_ENVIRONMENT variable in order to filter panics in sentry
by environment.
This commit is contained in:
committed by
Vadim Kharitonov
parent
02c1c351dc
commit
4603a4cbb5
@@ -10,11 +10,13 @@ pub fn init_sentry(
|
||||
extra_options: &[(&str, &str)],
|
||||
) -> Option<ClientInitGuard> {
|
||||
let dsn = env::var("SENTRY_DSN").ok()?;
|
||||
let environment = env::var("SENTRY_ENVIRONMENT").unwrap_or_else(|_| "development".into());
|
||||
|
||||
let guard = sentry::init((
|
||||
dsn,
|
||||
sentry::ClientOptions {
|
||||
release: release_name,
|
||||
environment: Some(environment.into()),
|
||||
..Default::default()
|
||||
},
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user