forked from mirror/reqwest-middleware
Update example in tracing README (#76)
parent
289bb0452c
commit
a7f9a112ed
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue