You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to register a new field http.request.resend_count to my Otel trace but I don't have access to this information by implementing ReqwestOtelSpanBackend.
Solution
Register the number of retries in the extension of the current request.
Alternatives
I tried to inspect the logs message of the current Span inside the on_request_end() function to get this data from the warn event but it's tedious and I don't think it's even possible.
Additional context
Here is my current code
implReqwestOtelSpanBackendforOtelTrace{fnon_request_start(req:&Request,extension:&mutExtensions) -> Span{let otel_span_name = format!("{:#?} {:#?}", req.method(), req.url().path()).trim().to_owned();reqwest_otel_span!(
level = Level::INFO,
name = otel_span_name,
req,
url.full = req.url().to_string(),
http.request.resend_count = tracing::field::Empty,)}fnon_request_end(span:&Span,outcome:&ResultReqwest<Response>,extension:&mutExtensions){// This would be someting like thislet retries = extension.get::<RequestRetries>().unwrap().count;
span.record("http.request.resend_count", retries);default_on_request_end(span, outcome);}}
I could take the PR if it sounds good for you.
The text was updated successfully, but these errors were encountered:
Motivations
I tried to register a new field http.request.resend_count to my Otel trace but I don't have access to this information by implementing ReqwestOtelSpanBackend.
Solution
Register the number of retries in the extension of the current request.
Alternatives
I tried to inspect the logs message of the current Span inside the on_request_end() function to get this data from the
warn event but it's tedious and I don't think it's even possible.
Additional context
Here is my current code
I could take the PR if it sounds good for you.
The text was updated successfully, but these errors were encountered: