Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
account for process_events errors in capture_events_dropped_total and…
Browse files Browse the repository at this point in the history
… log them
  • Loading branch information
xvello committed Nov 21, 2023
1 parent 6cee0a5 commit 9cd2deb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion capture/src/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ pub async fn event(

tracing::debug!(context=?context, events=?events, "decoded request");

process_events(state.sink.clone(), &events, &context).await?;
if let Err(err) = process_events(state.sink.clone(), &events, &context).await {
report_dropped_events("process_events_error", events.len() as u64);
tracing::log::warn!("rejected invalid payload: {}", err);
return Err(err)
}

Ok(Json(CaptureResponse {
status: CaptureResponseCode::Ok,
Expand Down

0 comments on commit 9cd2deb

Please sign in to comment.