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 (#58)
  • Loading branch information
xvello authored Nov 21, 2023
1 parent 6cee0a5 commit f8a07fb
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 f8a07fb

Please sign in to comment.