@@ -74,7 +74,7 @@ impl<'a> WasiHttpView for WasiHttpImplInner<'a> {
74
74
skip_all,
75
75
fields(
76
76
otel. kind = "client" ,
77
- url. full = %request . uri ( ) ,
77
+ url. full = Empty ,
78
78
http. request. method = %request. method( ) ,
79
79
otel. name = %request. method( ) ,
80
80
http. response. status_code = Empty ,
@@ -127,6 +127,10 @@ async fn send_request_impl(
127
127
}
128
128
* uri = builder. build ( ) . unwrap ( ) ;
129
129
}
130
+ let span = tracing:: Span :: current ( ) ;
131
+ span. record ( "url.full" , uri. to_string ( ) ) ;
132
+
133
+ spin_telemetry:: inject_trace_context ( & mut request) ;
130
134
131
135
if let Some ( interceptor) = request_interceptor {
132
136
match interceptor. intercept ( & mut request, & mut config) . await ? {
@@ -165,17 +169,15 @@ async fn send_request_impl(
165
169
config. use_tls = origin. use_tls ( ) ;
166
170
167
171
request. headers_mut ( ) . insert ( HOST , origin. host_header ( ) ) ;
168
- spin_telemetry:: inject_trace_context ( & mut request) ;
169
172
170
173
let path_and_query = request. uri ( ) . path_and_query ( ) . cloned ( ) ;
171
174
* request. uri_mut ( ) = origin. into_uri ( path_and_query) ;
172
175
}
173
176
174
177
let authority = request. uri ( ) . authority ( ) . context ( "authority not set" ) ?;
175
- let current_span = tracing:: Span :: current ( ) ;
176
- current_span. record ( "server.address" , authority. host ( ) ) ;
178
+ span. record ( "server.address" , authority. host ( ) ) ;
177
179
if let Some ( port) = authority. port ( ) {
178
- current_span . record ( "server.port" , port. as_u16 ( ) ) ;
180
+ span . record ( "server.port" , port. as_u16 ( ) ) ;
179
181
}
180
182
181
183
Ok ( send_request_handler ( request, config, tls_client_config, allow_private_ips) . await )
@@ -315,6 +317,8 @@ async fn send_request_handler(
315
317
. map_err ( hyper_request_error) ?
316
318
. map ( |body| body. map_err ( hyper_request_error) . boxed ( ) ) ;
317
319
320
+ tracing:: Span :: current ( ) . record ( "http.response.status_code" , resp. status ( ) . as_u16 ( ) ) ;
321
+
318
322
Ok ( wasmtime_wasi_http:: types:: IncomingResponse {
319
323
resp,
320
324
worker : Some ( worker) ,
0 commit comments