diff --git a/Cargo.lock b/Cargo.lock index 7369da7ba47d..02bcbe0365dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1542,6 +1542,7 @@ dependencies = [ "file-engine", "frontend", "futures", + "human-panic", "lazy_static", "meta-client", "meta-srv", @@ -3861,6 +3862,22 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "human-panic" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a79a67745be0cb8dd2771f03b24c2f25df98d5471fe7a595d668cfa2e6f843d" +dependencies = [ + "anstream", + "anstyle", + "backtrace", + "os_info", + "serde", + "serde_derive", + "toml 0.8.8", + "uuid", +] + [[package]] name = "humantime" version = "2.1.0" @@ -5790,6 +5807,17 @@ dependencies = [ "hashbrown 0.14.3", ] +[[package]] +name = "os_info" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" +dependencies = [ + "log", + "serde", + "winapi", +] + [[package]] name = "os_str_bytes" version = "6.6.1" @@ -9855,6 +9883,18 @@ dependencies = [ "toml_edit 0.19.15", ] +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", +] + [[package]] name = "toml_datetime" version = "0.6.3" @@ -9888,6 +9928,18 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", +] + [[package]] name = "tonic" version = "0.9.2" diff --git a/src/cmd/Cargo.toml b/src/cmd/Cargo.toml index c28b2982877b..7cf890356f6e 100644 --- a/src/cmd/Cargo.toml +++ b/src/cmd/Cargo.toml @@ -40,6 +40,7 @@ etcd-client.workspace = true file-engine.workspace = true frontend.workspace = true futures.workspace = true +human-panic = "1.2.2" lazy_static.workspace = true meta-client.workspace = true meta-srv.workspace = true diff --git a/src/cmd/src/bin/greptime.rs b/src/cmd/src/bin/greptime.rs index d8f19df4b613..070a79868abb 100644 --- a/src/cmd/src/bin/greptime.rs +++ b/src/cmd/src/bin/greptime.rs @@ -95,6 +95,14 @@ static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; #[tokio::main] async fn main() -> Result<()> { + let metadata = human_panic::Metadata { + version: env!("CARGO_PKG_VERSION").into(), + name: "GreptimeDB".into(), + authors: Default::default(), + homepage: "https://github.com/GreptimeTeam/greptimedb/discussions".into(), + }; + human_panic::setup_panic!(metadata); + common_telemetry::set_panic_hook(); let cli = greptimedb_cli();