Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion objectstore-server/src/observability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ pub fn init_sentry(config: &Config) -> Option<sentry::ClientInitGuard> {
let config = &config.sentry;
let dsn = config.dsn.as_ref()?;

let dsn = match dsn.expose_secret().parse() {
Ok(dsn) => Some(dsn),
Err(error) => {
// Sentry is initialized before the tracing subscriber, so a `warn!` here would be
// dropped. Write to stderr instead to make the misconfiguration visible.
eprintln!("WARN: invalid Sentry DSN, error reporting is disabled: {error}");
None
}
};

let guard = sentry::init(sentry::ClientOptions {
dsn: dsn.expose_secret().parse().ok(),
dsn,
release: Some(RELEASE.into()),
environment: config.environment.clone(),
server_name: config.server_name.clone(),
Expand Down
4 changes: 3 additions & 1 deletion objectstore-service/src/backend/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,7 @@ pub(super) fn reqwest_client() -> reqwest::Client {
.no_gzip()
.no_deflate()
.build()
.expect("Client::new()")
// INVARIANT: Building fails only if the TLS backend cannot be initialized, which
// is checked at startup when the rustls crypto provider is installed.
.expect("failed to build backend HTTP client")
}
Loading