From fd04812cde2e08f145a77b6abe5e9842fcd8cc08 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sat, 16 Nov 2024 16:28:42 +0000 Subject: [PATCH] chore(gateway): proactive close telemetry session (#7361) This is important for the "Release Health" statistics of Sentry. --- rust/gateway/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/gateway/src/main.rs b/rust/gateway/src/main.rs index 0e2a0128a..d57376796 100644 --- a/rust/gateway/src/main.rs +++ b/rust/gateway/src/main.rs @@ -55,8 +55,12 @@ async fn main() { // That looks like a "crash" but we "just" exit with a fatal error. if let Err(e) = try_main(cli, &mut telemetry).await { tracing::error!(error = anyhow_dyn_err(&e)); + telemetry.stop_on_crash().await; + std::process::exit(1); } + + telemetry.stop().await } async fn try_main(cli: Cli, telemetry: &mut Telemetry) -> Result<()> {