pigeon_telemetry 0.3.0

NOLAI standardized OpenTelemetry setup for Rust applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};
use reqwest_tracing::{SpanBackendWithUrl, TracingMiddleware};

pub struct TracedHttpClient;

impl TracedHttpClient {
    #[allow(clippy::new_ret_no_self)]
    pub fn new() -> ClientWithMiddleware {
        ClientBuilder::new(reqwest::Client::new())
            .with(TracingMiddleware::<SpanBackendWithUrl>::new())
            .build()
    }
}