Skip to content

Commit

Permalink
Ensure some information is logged for every request
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lyne committed Jun 29, 2022
1 parent 6804aa5 commit aafbfaa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/svix-server/src/core/otel_spans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,18 @@ impl<B> OnResponse<B> for AxumOtelOnResponse {
fn on_response(
self,
response: &http::Response<B>,
_latency: std::time::Duration,
latency: std::time::Duration,
span: &tracing::Span,
) {
let status = response.status().as_u16().to_string();
span.record("http.status_code", &tracing::field::display(status));
span.record("otel.status_code", &"OK");

tracing::debug!(
"finished processing request latency={} ms status={}",
latency.as_millis(),
response.status().as_u16(),
);
}
}

Expand Down

0 comments on commit aafbfaa

Please sign in to comment.