diff --git a/crates/symbolicator-service/src/services/symbolication/apple.rs b/crates/symbolicator-service/src/services/symbolication/apple.rs index 5fd060a2c..917ac87f4 100644 --- a/crates/symbolicator-service/src/services/symbolication/apple.rs +++ b/crates/symbolicator-service/src/services/symbolication/apple.rs @@ -15,7 +15,7 @@ use crate::types::{ }; use crate::utils::hex::HexValue; -use super::{StacktraceOrigin, SymbolicateStacktraces, SymbolicationActor}; +use super::{ScrapingConfig, StacktraceOrigin, SymbolicateStacktraces, SymbolicationActor}; impl SymbolicationActor { #[tracing::instrument(skip_all)] @@ -24,6 +24,7 @@ impl SymbolicationActor { scope: Scope, report: File, sources: Arc<[SourceConfig]>, + scraping: ScrapingConfig, ) -> Result<(SymbolicateStacktraces, AppleCrashReportState)> { let report = AppleCrashReport::from_reader(report).context("failed to parse apple crash report")?; @@ -79,7 +80,7 @@ impl SymbolicationActor { signal: None, stacktraces, apply_source_context: true, - scraping: Default::default(), + scraping, }; let mut system_info = SystemInfo { @@ -124,8 +125,9 @@ impl SymbolicationActor { scope: Scope, report: File, sources: Arc<[SourceConfig]>, + scraping: ScrapingConfig, ) -> Result { - let (request, state) = self.parse_apple_crash_report(scope, report, sources)?; + let (request, state) = self.parse_apple_crash_report(scope, report, sources, scraping)?; let mut response = self.symbolicate(request).await?; state.merge_into(&mut response); diff --git a/crates/symbolicator-service/src/services/symbolication/process_minidump.rs b/crates/symbolicator-service/src/services/symbolication/process_minidump.rs index 2fcb334df..9b79dcb78 100644 --- a/crates/symbolicator-service/src/services/symbolication/process_minidump.rs +++ b/crates/symbolicator-service/src/services/symbolication/process_minidump.rs @@ -29,7 +29,7 @@ use crate::types::{ }; use crate::utils::hex::HexValue; -use super::{StacktraceOrigin, SymbolicateStacktraces, SymbolicationActor}; +use super::{ScrapingConfig, StacktraceOrigin, SymbolicateStacktraces, SymbolicationActor}; type Minidump = minidump::Minidump<'static, ByteView<'static>>; @@ -404,9 +404,10 @@ impl SymbolicationActor { scope: Scope, minidump_file: TempPath, sources: Arc<[SourceConfig]>, + scraping: ScrapingConfig, ) -> Result { let (request, state) = self - .stackwalk_minidump(scope, minidump_file, sources) + .stackwalk_minidump(scope, minidump_file, sources, scraping) .await?; let mut response = self.symbolicate(request).await?; @@ -421,6 +422,7 @@ impl SymbolicationActor { scope: Scope, minidump_file: TempPath, sources: Arc<[SourceConfig]>, + scraping: ScrapingConfig, ) -> Result<(SymbolicateStacktraces, MinidumpState)> { let len = minidump_file.metadata()?.len(); tracing::debug!("Processing minidump ({} bytes)", len); @@ -476,7 +478,7 @@ impl SymbolicationActor { signal: None, stacktraces, apply_source_context: true, - scraping: Default::default(), + scraping, }; Ok((request, minidump_state)) diff --git a/crates/symbolicator-service/tests/integration/process_minidump.rs b/crates/symbolicator-service/tests/integration/process_minidump.rs index 53c29f6c9..0ee3506d1 100644 --- a/crates/symbolicator-service/tests/integration/process_minidump.rs +++ b/crates/symbolicator-service/tests/integration/process_minidump.rs @@ -21,6 +21,7 @@ macro_rules! stackwalk_minidump { Scope::Global, minidump_file.into_temp_path(), Arc::new([source]), + Default::default(), ) .await; diff --git a/crates/symbolicator-service/tests/integration/symbolication.rs b/crates/symbolicator-service/tests/integration/symbolication.rs index 850777f6e..dea2669e6 100644 --- a/crates/symbolicator-service/tests/integration/symbolication.rs +++ b/crates/symbolicator-service/tests/integration/symbolication.rs @@ -53,7 +53,12 @@ async fn test_apple_crash_report() { let report_file = std::fs::File::open(fixture("apple_crash_report.txt")).unwrap(); let response = symbolication - .process_apple_crash_report(Scope::Global, report_file, Arc::new([source])) + .process_apple_crash_report( + Scope::Global, + report_file, + Arc::new([source]), + Default::default(), + ) .await; assert_snapshot!(response.unwrap()); diff --git a/crates/symbolicator-stress/src/workloads.rs b/crates/symbolicator-stress/src/workloads.rs index 3367f2b3f..a5ce1b243 100644 --- a/crates/symbolicator-stress/src/workloads.rs +++ b/crates/symbolicator-stress/src/workloads.rs @@ -159,7 +159,12 @@ pub async fn process_payload(symbolication: &SymbolicationActor, workload: &Pars .unwrap(); symbolication - .process_minidump(scope.clone(), temp_path, Arc::clone(sources)) + .process_minidump( + scope.clone(), + temp_path, + Arc::clone(sources), + Default::default(), + ) .await .unwrap(); } diff --git a/crates/symbolicator/src/endpoints/applecrashreport.rs b/crates/symbolicator/src/endpoints/applecrashreport.rs index 408dda722..75199d09d 100644 --- a/crates/symbolicator/src/endpoints/applecrashreport.rs +++ b/crates/symbolicator/src/endpoints/applecrashreport.rs @@ -21,6 +21,7 @@ pub async fn handle_apple_crash_report_request( let mut report = None; let mut sources = service.config().default_sources(); + let mut scraping = Default::default(); let mut options = RequestOptions::default(); while let Some(field) = multipart.next_field().await? { @@ -34,6 +35,10 @@ pub async fn handle_apple_crash_report_request( let data = read_multipart_data(field, 1024 * 1024).await?; // 1Mb sources = serde_json::from_slice(&data)?; } + Some("scraping") => { + let data = read_multipart_data(field, 1024 * 1024).await?; // 1Mb + scraping = serde_json::from_slice(&data)?; + } Some("options") => { let data = read_multipart_data(field, 1024 * 1024).await?; // 1Mb options = serde_json::from_slice(&data)? @@ -44,7 +49,8 @@ pub async fn handle_apple_crash_report_request( let report = report.ok_or((StatusCode::BAD_REQUEST, "missing apple crash report"))?; - let request_id = service.process_apple_crash_report(params.scope, report, sources, options)?; + let request_id = + service.process_apple_crash_report(params.scope, report, sources, scraping, options)?; match service.get_response(request_id, params.timeout).await { Some(response) => Ok(Json(response)), diff --git a/crates/symbolicator/src/endpoints/minidump.rs b/crates/symbolicator/src/endpoints/minidump.rs index e5bfc72f0..e51fc677d 100644 --- a/crates/symbolicator/src/endpoints/minidump.rs +++ b/crates/symbolicator/src/endpoints/minidump.rs @@ -23,6 +23,7 @@ pub async fn handle_minidump_request( let mut minidump = None; let mut sources = service.config().default_sources(); + let mut scraping = Default::default(); let mut options = RequestOptions::default(); while let Some(field) = multipart.next_field().await? { @@ -44,6 +45,10 @@ pub async fn handle_minidump_request( let data = read_multipart_data(field, 1024 * 1024).await?; // 1Mb sources = serde_json::from_slice(&data)?; } + Some("scraping") => { + let data = read_multipart_data(field, 1024 * 1024).await?; // 1Mb + scraping = serde_json::from_slice(&data)?; + } Some("options") => { let data = read_multipart_data(field, 1024 * 1024).await?; // 1Mb options = serde_json::from_slice(&data)?; @@ -65,7 +70,8 @@ pub async fn handle_minidump_request( ) .into()); } - let request_id = service.process_minidump(params.scope, minidump_file, sources, options)?; + let request_id = + service.process_minidump(params.scope, minidump_file, sources, scraping, options)?; match service.get_response(request_id, params.timeout).await { Some(response) => Ok(Json(response)), diff --git a/crates/symbolicator/src/service.rs b/crates/symbolicator/src/service.rs index 45d627a5c..d22678059 100644 --- a/crates/symbolicator/src/service.rs +++ b/crates/symbolicator/src/service.rs @@ -24,6 +24,7 @@ use futures::{channel::oneshot, FutureExt as _}; use sentry::protocol::SessionStatus; use sentry::SentryFutureExt; use serde::{Deserialize, Deserializer, Serialize}; +use symbolicator_service::services::ScrapingConfig; use tempfile::TempPath; use uuid::Uuid; @@ -271,12 +272,13 @@ impl RequestService { scope: Scope, minidump_file: TempPath, sources: Arc<[SourceConfig]>, + scraping: ScrapingConfig, options: RequestOptions, ) -> Result { let slf = self.inner.clone(); self.create_symbolication_request("minidump_stackwalk", options, async move { slf.symbolication - .process_minidump(scope, minidump_file, sources) + .process_minidump(scope, minidump_file, sources, scraping) .await .map(Into::into) }) @@ -291,12 +293,13 @@ impl RequestService { scope: Scope, apple_crash_report: File, sources: Arc<[SourceConfig]>, + scraping: ScrapingConfig, options: RequestOptions, ) -> Result { let slf = self.inner.clone(); self.create_symbolication_request("parse_apple_crash_report", options, async move { slf.symbolication - .process_apple_crash_report(scope, apple_crash_report, sources) + .process_apple_crash_report(scope, apple_crash_report, sources, scraping) .await .map(Into::into) }) diff --git a/crates/symbolicli/src/main.rs b/crates/symbolicli/src/main.rs index 08063b22a..dd651712c 100644 --- a/crates/symbolicli/src/main.rs +++ b/crates/symbolicli/src/main.rs @@ -177,7 +177,7 @@ async fn main() -> Result<()> { Payload::Minidump(minidump_path) => { tracing::info!("symbolicating minidump"); symbolication - .process_minidump(scope, minidump_path, dsym_sources) + .process_minidump(scope, minidump_path, dsym_sources, Default::default()) .await .map(CompletedResponse::from)? }