Add session id to panic events
This commit is contained in:
parent
c46137e40d
commit
2c7e37e9ff
2 changed files with 30 additions and 24 deletions
|
@ -74,7 +74,8 @@ fn main() {
|
|||
let mut app = gpui::App::new(Assets).unwrap();
|
||||
|
||||
let installation_id = app.background().block(installation_id()).ok();
|
||||
init_panic_hook(&app, installation_id.clone());
|
||||
let session_id = Uuid::new_v4().to_string();
|
||||
init_panic_hook(&app, installation_id.clone(), session_id.clone());
|
||||
|
||||
load_embedded_fonts(&app);
|
||||
|
||||
|
@ -177,7 +178,7 @@ fn main() {
|
|||
})
|
||||
.detach();
|
||||
|
||||
client.telemetry().start(installation_id, cx);
|
||||
client.telemetry().start(installation_id, session_id, cx);
|
||||
|
||||
let app_state = Arc::new(AppState {
|
||||
languages,
|
||||
|
@ -402,6 +403,7 @@ struct Panic {
|
|||
panicked_on: u128,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
installation_id: Option<String>,
|
||||
session_id: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
@ -412,7 +414,7 @@ struct PanicRequest {
|
|||
|
||||
static PANIC_COUNT: AtomicU32 = AtomicU32::new(0);
|
||||
|
||||
fn init_panic_hook(app: &App, installation_id: Option<String>) {
|
||||
fn init_panic_hook(app: &App, installation_id: Option<String>, session_id: String) {
|
||||
let is_pty = stdout_is_a_pty();
|
||||
let platform = app.platform();
|
||||
|
||||
|
@ -490,6 +492,7 @@ fn init_panic_hook(app: &App, installation_id: Option<String>) {
|
|||
.as_millis(),
|
||||
backtrace,
|
||||
installation_id: installation_id.clone(),
|
||||
session_id: session_id.clone(),
|
||||
};
|
||||
|
||||
if is_pty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue