1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-02-23 02:43:16 +01:00

Fixed example for custom root span builder (#94)

This commit is contained in:
Harish Rajagopal 2022-12-23 11:13:45 +01:00 committed by GitHub
parent 302aef6285
commit e888999e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,4 @@
use actix_web::body::MessageBody;
use actix_web::dev::{ServiceRequest, ServiceResponse};
use actix_web::{web, App, Error, HttpServer};
use opentelemetry::{
@ -31,7 +32,7 @@ impl RootSpanBuilder for CustomRootSpanBuilder {
)
}
fn on_request_end<B>(span: Span, outcome: &Result<ServiceResponse<B>, Error>) {
fn on_request_end<B: MessageBody>(span: Span, outcome: &Result<ServiceResponse<B>, Error>) {
// Capture the standard fields when the request finishes.
DefaultRootSpanBuilder::on_request_end(span, outcome);
}