Add minidump crash reporting (#35263)
- [x] Handle uploading minidumps from the remote_server - [x] Associate minidumps with panics with some sort of ID (we don't use session_id on the remote) - [x] Update the protobufs and client/server code to request panics - [x] Upload minidumps with no corresponding panic - [x] Fill in panic info when there _is_ a corresponding panic - [x] Use an env var for the sentry endpoint instead of hardcoding it Release Notes: - Zed now generates minidumps for crash reporting --------- Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
07e3d53d58
commit
669c57b45f
25 changed files with 709 additions and 135 deletions
|
@ -4,14 +4,13 @@ use std::{any::type_name, borrow::Cow, mem, pin::Pin, task::Poll, time::Duration
|
|||
|
||||
use anyhow::anyhow;
|
||||
use bytes::{BufMut, Bytes, BytesMut};
|
||||
use futures::{AsyncRead, TryStreamExt as _};
|
||||
use futures::{AsyncRead, FutureExt as _, TryStreamExt as _};
|
||||
use http_client::{RedirectPolicy, Url, http};
|
||||
use regex::Regex;
|
||||
use reqwest::{
|
||||
header::{HeaderMap, HeaderValue},
|
||||
redirect,
|
||||
};
|
||||
use smol::future::FutureExt;
|
||||
|
||||
const DEFAULT_CAPACITY: usize = 4096;
|
||||
static RUNTIME: OnceLock<tokio::runtime::Runtime> = OnceLock::new();
|
||||
|
@ -274,6 +273,26 @@ impl http_client::HttpClient for ReqwestClient {
|
|||
}
|
||||
.boxed()
|
||||
}
|
||||
|
||||
fn send_multipart_form<'a>(
|
||||
&'a self,
|
||||
url: &str,
|
||||
form: reqwest::multipart::Form,
|
||||
) -> futures::future::BoxFuture<'a, anyhow::Result<http_client::Response<http_client::AsyncBody>>>
|
||||
{
|
||||
let response = self.client.post(url).multipart(form).send();
|
||||
self.handle
|
||||
.spawn(async move {
|
||||
let response = response.await?;
|
||||
let mut builder = http::response::Builder::new().status(response.status());
|
||||
for (k, v) in response.headers() {
|
||||
builder = builder.header(k, v)
|
||||
}
|
||||
Ok(builder.body(response.bytes().await?.into())?)
|
||||
})
|
||||
.map(|e| e?)
|
||||
.boxed()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue