fix: restore adding http.url as an attribute when deprecated_attributes feature is enabled
parent
603ef97144
commit
3ddfded9e3
|
@ -165,7 +165,13 @@ pub struct SpanBackendWithUrl;
|
||||||
impl ReqwestOtelSpanBackend for SpanBackendWithUrl {
|
impl ReqwestOtelSpanBackend for SpanBackendWithUrl {
|
||||||
fn on_request_start(req: &Request, ext: &mut Extensions) -> Span {
|
fn on_request_start(req: &Request, ext: &mut Extensions) -> Span {
|
||||||
let name = default_span_name(req, ext);
|
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) {
|
fn on_request_end(span: &Span, outcome: &Result<Response>, _: &mut Extensions) {
|
||||||
|
|
Loading…
Reference in New Issue