Skip to main content

grpc_server_layer

Function grpc_server_layer 

Source
pub fn grpc_server_layer() -> GrpcServerTraceLayer
Expand description

Construct the tower Layer that extracts trace context from incoming gRPC request metadata and opens a child span.

Requires the tonic-tracing feature. Attach to a tonic tonic::transport::Server via .layer(...), before .add_service(...).

§Example

let _ = tonic::transport::Server::builder()
    .layer(otel_bootstrap::grpc_server_layer());