Skip to content

Commit

Permalink
fix: restore adding http.url as an attribute when deprecated_attribut…
Browse files Browse the repository at this point in the history
…es feature is enabled
  • Loading branch information
tl-thomas-finlayson authored and eopb committed Aug 22, 2024
1 parent 603ef97 commit 3ddfded
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion reqwest-tracing/src/reqwest_otel_span_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,13 @@ pub struct SpanBackendWithUrl;
impl ReqwestOtelSpanBackend for SpanBackendWithUrl {
fn on_request_start(req: &Request, ext: &mut Extensions) -> Span {
let name = default_span_name(req, ext);
reqwest_otel_span!(name = name, req, url.full = %remove_credentials(req.url()))
let url = remove_credentials(req.url());
let span = reqwest_otel_span!(name = name, req, url.full = %url);
#[cfg(feature = "deprecated_attributes")]
{
span.record(HTTP_URL, url.to_string());
}
span
}

fn on_request_end(span: &Span, outcome: &Result<Response>, _: &mut Extensions) {
Expand Down

0 comments on commit 3ddfded

Please sign in to comment.