From 72d775f4455765c0c42ca779092e4237e8c2d699 Mon Sep 17 00:00:00 2001 From: Noah McGregor Harper <74685766+nharper285@users.noreply.github.com> Date: Fri, 27 Oct 2023 13:44:27 -0700 Subject: [PATCH] Emit `CrashReported` Metric to App insights. (#3571) * add * Emit CrashReported Metric to App insights. * Fixing. * removing? --- src/agent/onefuzz-task/src/tasks/report/crash_report.rs | 4 +++- src/agent/onefuzz-telemetry/src/lib.rs | 2 ++ src/proxy-manager/Cargo.lock | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/agent/onefuzz-task/src/tasks/report/crash_report.rs b/src/agent/onefuzz-task/src/tasks/report/crash_report.rs index 9ae618ce93..407d449c0f 100644 --- a/src/agent/onefuzz-task/src/tasks/report/crash_report.rs +++ b/src/agent/onefuzz-task/src/tasks/report/crash_report.rs @@ -6,7 +6,7 @@ use onefuzz::{blob::BlobUrl, monitor::DirectoryMonitor, syncdir::SyncedDir}; use onefuzz_result::job_result::{JobResultData, JobResultSender, TaskJobResultClient}; use onefuzz_telemetry::{ Event::{ - new_report, new_unable_to_reproduce, new_unique_report, regression_report, + crash_reported, new_report, new_unable_to_reproduce, new_unique_report, regression_report, regression_unable_to_reproduce, }, EventData, @@ -166,6 +166,8 @@ impl CrashTestResult { match self { Self::CrashReport(report) => { // Use SHA-256 of call stack as dedupe key. + event!(crash_reported; EventData::Path = report.unique_blob_name()); + metric!(crash_reported; 1.0; EventData::Path = report.unique_blob_name()); if let Some(jr_client) = jr_client { let _ = jr_client .send_direct( diff --git a/src/agent/onefuzz-telemetry/src/lib.rs b/src/agent/onefuzz-telemetry/src/lib.rs index f08b722695..21e427f06f 100644 --- a/src/agent/onefuzz-telemetry/src/lib.rs +++ b/src/agent/onefuzz-telemetry/src/lib.rs @@ -82,6 +82,7 @@ pub enum Event { runtime_stats, new_report, new_unique_report, + crash_reported, new_unable_to_reproduce, regression_report, regression_unable_to_reproduce, @@ -99,6 +100,7 @@ impl Event { Self::runtime_stats => "runtime_stats", Self::new_report => "new_report", Self::new_unique_report => "new_unique_report", + Self::crash_reported => "crash_reported", Self::new_unable_to_reproduce => "new_unable_to_reproduce", Self::regression_report => "regression_report", Self::regression_unable_to_reproduce => "regression_unable_to_reproduce", diff --git a/src/proxy-manager/Cargo.lock b/src/proxy-manager/Cargo.lock index 98e66a2468..e48d028374 100644 --- a/src/proxy-manager/Cargo.lock +++ b/src/proxy-manager/Cargo.lock @@ -1203,9 +1203,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.18" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ "bitflags 2.4.0", "errno",