Add sentry
This commit is contained in:
parent
be0d9eecb7
commit
d631b821e5
6 changed files with 107 additions and 2 deletions
91
Cargo.lock
generated
91
Cargo.lock
generated
|
@ -4476,6 +4476,16 @@ dependencies = [
|
||||||
"zlog",
|
"zlog",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "debugid"
|
||||||
|
version = "0.8.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"uuid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deepseek"
|
name = "deepseek"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -7973,6 +7983,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls 0.26.2",
|
"tokio-rustls 0.26.2",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
|
"webpki-roots",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -13551,6 +13562,7 @@ dependencies = [
|
||||||
"http-body 1.0.1",
|
"http-body 1.0.1",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper 1.6.0",
|
"hyper 1.6.0",
|
||||||
|
"hyper-rustls 0.27.5",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"ipnet",
|
"ipnet",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
|
@ -13559,17 +13571,23 @@ dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
|
"quinn",
|
||||||
|
"rustls 0.23.26",
|
||||||
|
"rustls-pemfile 2.2.0",
|
||||||
|
"rustls-pki-types",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"sync_wrapper 1.0.2",
|
"sync_wrapper 1.0.2",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
"tokio-rustls 0.26.2",
|
||||||
"tower 0.5.2",
|
"tower 0.5.2",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"url",
|
"url",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
|
"webpki-roots",
|
||||||
"windows-registry 0.4.0",
|
"windows-registry 0.4.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -14581,6 +14599,49 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sentry"
|
||||||
|
version = "0.41.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "507ac2be9bf2da56c831da57faf1dadd81f434bd282935cdb06193d0c94e8811"
|
||||||
|
dependencies = [
|
||||||
|
"httpdate",
|
||||||
|
"reqwest 0.12.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rustls 0.23.26",
|
||||||
|
"sentry-core",
|
||||||
|
"tokio",
|
||||||
|
"ureq",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sentry-core"
|
||||||
|
version = "0.41.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "00e9bd2cadaeda3af41e9fa5d14645127d6f6a4aec73da3ae38e477ecafd3682"
|
||||||
|
dependencies = [
|
||||||
|
"rand 0.9.1",
|
||||||
|
"sentry-types",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sentry-types"
|
||||||
|
version = "0.41.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a08e7154abe2cd557f26fd70038452810748aefdf39bc973f674421224b147c1"
|
||||||
|
dependencies = [
|
||||||
|
"debugid",
|
||||||
|
"hex",
|
||||||
|
"rand 0.9.1",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror 2.0.12",
|
||||||
|
"time",
|
||||||
|
"url",
|
||||||
|
"uuid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.219"
|
version = "1.0.219"
|
||||||
|
@ -17470,6 +17531,35 @@ version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
|
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ureq"
|
||||||
|
version = "3.0.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9f0fde9bc91026e381155f8c67cb354bcd35260b2f4a29bcc84639f762760c39"
|
||||||
|
dependencies = [
|
||||||
|
"base64 0.22.1",
|
||||||
|
"log",
|
||||||
|
"percent-encoding",
|
||||||
|
"rustls 0.23.26",
|
||||||
|
"rustls-pemfile 2.2.0",
|
||||||
|
"rustls-pki-types",
|
||||||
|
"ureq-proto",
|
||||||
|
"utf-8",
|
||||||
|
"webpki-roots",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ureq-proto"
|
||||||
|
version = "0.4.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "59db78ad1923f2b1be62b6da81fe80b173605ca0d57f85da2e005382adf693f7"
|
||||||
|
dependencies = [
|
||||||
|
"base64 0.22.1",
|
||||||
|
"http 1.3.1",
|
||||||
|
"httparse",
|
||||||
|
"log",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "url"
|
name = "url"
|
||||||
version = "2.5.4"
|
version = "2.5.4"
|
||||||
|
@ -20269,6 +20359,7 @@ dependencies = [
|
||||||
"reqwest_client",
|
"reqwest_client",
|
||||||
"rope",
|
"rope",
|
||||||
"search",
|
"search",
|
||||||
|
"sentry",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"session",
|
"session",
|
||||||
|
|
|
@ -559,6 +559,7 @@ rustls-platform-verifier = "0.5.0"
|
||||||
scap = { git = "https://github.com/zed-industries/scap", rev = "808aa5c45b41e8f44729d02e38fd00a2fe2722e7", default-features = false }
|
scap = { git = "https://github.com/zed-industries/scap", rev = "808aa5c45b41e8f44729d02e38fd00a2fe2722e7", default-features = false }
|
||||||
schemars = { version = "1.0", features = ["indexmap2"] }
|
schemars = { version = "1.0", features = ["indexmap2"] }
|
||||||
semver = "1.0"
|
semver = "1.0"
|
||||||
|
sentry = { version = "0.41", default-features = false, features = ["reqwest", "rustls"] }
|
||||||
serde = { version = "1.0", features = ["derive", "rc"] }
|
serde = { version = "1.0", features = ["derive", "rc"] }
|
||||||
serde_derive = { version = "1.0", features = ["deserialize_in_place"] }
|
serde_derive = { version = "1.0", features = ["deserialize_in_place"] }
|
||||||
serde_json = { version = "1.0", features = ["preserve_order", "raw_value"] }
|
serde_json = { version = "1.0", features = ["preserve_order", "raw_value"] }
|
||||||
|
|
|
@ -119,6 +119,7 @@ repl.workspace = true
|
||||||
reqwest_client.workspace = true
|
reqwest_client.workspace = true
|
||||||
rope.workspace = true
|
rope.workspace = true
|
||||||
search.workspace = true
|
search.workspace = true
|
||||||
|
sentry.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
session.workspace = true
|
session.workspace = true
|
||||||
|
|
|
@ -374,7 +374,7 @@ pub fn main() {
|
||||||
|
|
||||||
release_channel::init(app_version, cx);
|
release_channel::init(app_version, cx);
|
||||||
gpui_tokio::init(cx);
|
gpui_tokio::init(cx);
|
||||||
if let Some(app_commit_sha) = app_commit_sha {
|
if let Some(app_commit_sha) = app_commit_sha.clone() {
|
||||||
AppCommitSha::set_global(app_commit_sha, cx);
|
AppCommitSha::set_global(app_commit_sha, cx);
|
||||||
}
|
}
|
||||||
settings::init(cx);
|
settings::init(cx);
|
||||||
|
@ -534,6 +534,7 @@ pub fn main() {
|
||||||
session_id.clone(),
|
session_id.clone(),
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
|
reliability::init_sentry(app_commit_sha, cx);
|
||||||
|
|
||||||
SystemAppearance::init(cx);
|
SystemAppearance::init(cx);
|
||||||
theme::init(theme::LoadThemes::All(Box::new(Assets)), cx);
|
theme::init(theme::LoadThemes::All(Box::new(Assets)), cx);
|
||||||
|
|
|
@ -12,6 +12,7 @@ use release_channel::{AppCommitSha, RELEASE_CHANNEL, ReleaseChannel};
|
||||||
use settings::Settings;
|
use settings::Settings;
|
||||||
use smol::stream::StreamExt;
|
use smol::stream::StreamExt;
|
||||||
use std::{
|
use std::{
|
||||||
|
borrow::Cow,
|
||||||
env,
|
env,
|
||||||
ffi::{OsStr, c_void},
|
ffi::{OsStr, c_void},
|
||||||
sync::{Arc, atomic::Ordering},
|
sync::{Arc, atomic::Ordering},
|
||||||
|
@ -22,6 +23,7 @@ use url::Url;
|
||||||
use util::ResultExt;
|
use util::ResultExt;
|
||||||
|
|
||||||
static PANIC_COUNT: AtomicU32 = AtomicU32::new(0);
|
static PANIC_COUNT: AtomicU32 = AtomicU32::new(0);
|
||||||
|
const SENTRY_DSN: &str = "https://63c6474f7e8152fe89b05795f1763e72@o4509715134283776.ingest.us.sentry.io/4509715135987712";
|
||||||
|
|
||||||
pub fn init_panic_hook(
|
pub fn init_panic_hook(
|
||||||
app_version: SemanticVersion,
|
app_version: SemanticVersion,
|
||||||
|
@ -152,6 +154,15 @@ pub fn init_panic_hook(
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn init_sentry(app_commit_sha: Option<AppCommitSha>, cx: &mut App) {
|
||||||
|
let mut options = sentry::ClientOptions::default();
|
||||||
|
options.release = app_commit_sha.map(|sha| Cow::Owned(sha.short()));
|
||||||
|
if TelemetrySettings::get_global(cx).diagnostics {
|
||||||
|
std::mem::forget(sentry::init((SENTRY_DSN, options)));
|
||||||
|
}
|
||||||
|
panic!("another panic");
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
fn get_main_module_base_address() -> *mut c_void {
|
fn get_main_module_base_address() -> *mut c_void {
|
||||||
let mut dl_info = libc::Dl_info {
|
let mut dl_info = libc::Dl_info {
|
||||||
|
|
|
@ -125,7 +125,7 @@ pub fn init(cx: &mut App) {
|
||||||
|
|
||||||
cx.on_action(|_: &RestoreBanner, cx| title_bar::restore_banner(cx));
|
cx.on_action(|_: &RestoreBanner, cx| title_bar::restore_banner(cx));
|
||||||
if ReleaseChannel::global(cx) == ReleaseChannel::Dev || cx.has_flag::<PanicFeatureFlag>() {
|
if ReleaseChannel::global(cx) == ReleaseChannel::Dev || cx.has_flag::<PanicFeatureFlag>() {
|
||||||
cx.on_action(|_: &TestPanic, _| panic!("Ran the TestPanic action"));
|
cx.on_action(|_: &TestPanic, _| panic!("You Ran the TestPanic action"));
|
||||||
}
|
}
|
||||||
cx.on_action(|_: &OpenLog, cx| {
|
cx.on_action(|_: &OpenLog, cx| {
|
||||||
with_active_or_new_workspace(cx, |workspace, window, cx| {
|
with_active_or_new_workspace(cx, |workspace, window, cx| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue