@@ -66,8 +66,10 @@ pub use hive_router_config::humantime_serde;
6666use hive_router_config:: { load_config, subscriptions:: CallbackConfig , HiveRouterConfig } ;
6767pub use hive_router_internal:: background_tasks;
6868use hive_router_internal:: telemetry:: {
69- logging:: targets, otel:: tracing_opentelemetry:: OpenTelemetrySpanExt ,
70- traces:: spans:: http_request:: HttpServerRequestSpan , TelemetryContext ,
69+ logging:: targets,
70+ otel:: { opentelemetry, tracing_opentelemetry:: OpenTelemetrySpanExt } ,
71+ traces:: spans:: http_request:: HttpServerRequestSpan ,
72+ TelemetryContext ,
7173} ;
7274pub use hive_router_internal:: BoxError ;
7375use hive_router_internal:: {
@@ -186,9 +188,14 @@ async fn graphql_endpoint_handler(
186188 "http request attributes" ,
187189 ) ;
188190
189- let inner_res =
190- graphql_endpoint_dispatch ( & mut request, body_stream, schema_state, app_state. clone ( ) )
191- . await ;
191+ let inner_res = graphql_endpoint_dispatch (
192+ & mut request,
193+ body_stream,
194+ schema_state,
195+ app_state. clone ( ) ,
196+ parent_ctx,
197+ )
198+ . await ;
192199
193200 let payload_bytes = match inner_res. body ( ) . size ( ) {
194201 BodySize :: Empty | BodySize :: None => 0 ,
@@ -234,10 +241,8 @@ async fn graphql_endpoint_dispatch(
234241 body_stream : web:: types:: Payload ,
235242 schema_state : web:: types:: State < Arc < SchemaState > > ,
236243 app_state : web:: types:: State < Arc < RouterSharedState > > ,
244+ parent_ctx : opentelemetry:: Context ,
237245) -> web:: HttpResponse {
238- let parent_ctx = app_state
239- . telemetry_context
240- . extract_context ( & HeaderExtractor ( request. headers ( ) ) ) ;
241246 let root_http_request_span = HttpServerRequestSpan :: from_request (
242247 request,
243248 & app_state
0 commit comments