Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Emit CrashReported Metric to App insights. (#3571)
Browse files Browse the repository at this point in the history
* add

* Emit CrashReported Metric to App insights.

* Fixing.

* removing?
  • Loading branch information
nharper285 authored Oct 27, 2023
1 parent 4a67a48 commit 72d775f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/agent/onefuzz-task/src/tasks/report/crash_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions src/agent/onefuzz-telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/proxy-manager/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 72d775f

Please sign in to comment.