Skip to main content

OtlpTransport

Trait OtlpTransport 

pub trait OtlpTransport {
    // Required method
    fn send_proto<Req, Resp>(
        &self,
        signal: SignalKind,
        request: Req,
    ) -> impl Future<Output = Result<Resp, OTelSdkError>> + Send
       where Req: Message + Send + 'static,
             Resp: Message + Default + Send + 'static;
}
Available on crate features http and grpc and opentelemetry only.
Expand description

How OtelExporter actually sends a protobuf-encoded OTLP request for a given signal. Implemented for OtelExporter<S, HeaderMap> (HTTP) and OtelExporter<S, MetadataMap> (gRPC).

Required Methods§

fn send_proto<Req, Resp>( &self, signal: SignalKind, request: Req, ) -> impl Future<Output = Result<Resp, OTelSdkError>> + Send
where Req: Message + Send + 'static, Resp: Message + Default + Send + 'static,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<S> OtlpTransport for OtelExporter<S, HeaderMap>
where S: Debug + Clone + Send + Sync + 'static + Service<Request, Output = Response>, <S as Service<Request>>::Error: Into<Box<dyn Error + Send + Sync>>,

§

impl<S> OtlpTransport for OtelExporter<S, MetadataMap>
where S: Debug + Clone + Send + Sync + 'static + GrpcService<Body>, <S as GrpcService<Body>>::ResponseBody: Body + Send + Sync + 'static, <<S as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Send + Sync>>,