Skip to content

Commit

Permalink
chore: implement store & resolver in cymbal logic flow (#25592)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Oct 17, 2024
1 parent 94f3b36 commit 07cbe61
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion rust/cymbal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async fn main() -> Result<(), Error> {
continue;
};

let _stack_trace: Vec<RawFrame> = match serde_json::from_str(trace) {
let stack_trace: Vec<RawFrame> = match serde_json::from_str(trace) {
Ok(r) => r,
Err(err) => {
metrics::counter!(ERRORS, "cause" => "invalid_stack_trace").increment(1);
Expand All @@ -113,6 +113,19 @@ async fn main() -> Result<(), Error> {
}
};

let mut resolved_frames = Vec::new();
for frame in stack_trace {
let resolved = match context.resolver.resolve(frame, 1).await {
Ok(r) => r,
Err(err) => {
metrics::counter!(ERRORS, "cause" => "frame_not_parsable").increment(1);
error!("Error parsing stack frame: {:?}", err);
continue;
}
};
resolved_frames.push(resolved);
}

metrics::counter!(STACK_PROCESSED).increment(1);
}
}

0 comments on commit 07cbe61

Please sign in to comment.