[−][src]Struct actix_web_opentelemetry::RequestTracing
Request tracing middleware.
Example:
use actix_web::{App, HttpServer, web}; use actix_web_opentelemetry::RequestTracing; use opentelemetry::api; fn init_tracer() { opentelemetry::global::set_provider(api::NoopProvider {}); } fn main() -> std::io::Result<()> { init_tracer(); HttpServer::new(|| { App::new() .wrap(RequestTracing::new(false)) .service(web::resource("/").to(|| "Hello world!")) }) .bind("127.0.0.1:8080")? .run() }
Methods
impl RequestTracing
[src]
pub fn new(extract_single_header: bool) -> Self
[src]
Configures a request tracing middleware transformer.
This middleware supports both version of B3 headers.
- Single Header:
- X-B3:
{trace_id}-{span_id}-{sampling_state}-{parent_span_id}
- Multiple Headers:
- X-B3-TraceId:
{trace_id}
- X-B3-ParentSpanId:
{parent_span_id}
- X-B3-SpanId:
{span_id}
- X-B3-Sampled:
{sampling_state}
- X-B3-Flags:
{debug_flag}
Trait Implementations
impl Debug for RequestTracing
[src]
impl<S, B> Transform<S> for RequestTracing where
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
S::Future: 'static,
B: 'static,
[src]
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
S::Future: 'static,
B: 'static,
type Request = ServiceRequest
Requests handled by the service.
type Response = ServiceResponse<B>
Responses given by the service.
type Error = Error
Errors produced by the service.
type Transform = RequestTracingMiddleware<S, HttpB3Propagator>
The TransformService
value created by this factory
type InitError = ()
Errors produced while building a service.
type Future = FutureResult<Self::Transform, Self::InitError>
The future response value.
fn new_transform(&self, service: S) -> Self::Future
[src]
fn map_init_err<F, E>(self, f: F) -> TransformMapInitErr<Self, S, F, E> where
F: Fn(Self::InitError) -> E,
F: Fn(Self::InitError) -> E,
fn from_err<E>(self) -> TransformFromErr<Self, S, E> where
E: From<Self::InitError>,
E: From<Self::InitError>,
Auto Trait Implementations
impl Send for RequestTracing
impl Sync for RequestTracing
impl Unpin for RequestTracing
impl UnwindSafe for RequestTracing
impl RefUnwindSafe for RequestTracing
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, S> IntoTransform<T, S> for T where
T: Transform<S>,
T: Transform<S>,
fn into_transform(self) -> T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,