Update example in tracing README (#76)

This commit is contained in:
John Vandenberg 2022-11-23 15:39:54 +08:00 committed by GitHub
parent 289bb0452c
commit a7f9a112ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,7 +44,7 @@ pub struct TimeTrace;
impl ReqwestOtelSpanBackend for TimeTrace { impl ReqwestOtelSpanBackend for TimeTrace {
fn on_request_start(req: &Request, extension: &mut Extensions) -> Span { fn on_request_start(req: &Request, extension: &mut Extensions) -> Span {
extension.insert(Instant::now()); extension.insert(Instant::now());
reqwest_otel_span!(req, time_elapsed = tracing::field::Empty) reqwest_otel_span!(name="example-request", req, time_elapsed = tracing::field::Empty)
} }
fn on_request_end(span: &Span, outcome: &Result<Response>, extension: &mut Extensions) { fn on_request_end(span: &Span, outcome: &Result<Response>, extension: &mut Extensions) {