@@ -3,12 +3,12 @@ use spin_world::v1::{
3
3
http as spin_http,
4
4
http_types:: { self , HttpError , Method , Request , Response } ,
5
5
} ;
6
- use tracing:: { field:: Empty , instrument, Level , Span } ;
6
+ use tracing:: { field:: Empty , instrument, Span } ;
7
7
8
8
use crate :: intercept:: InterceptOutcome ;
9
9
10
10
impl spin_http:: Host for crate :: InstanceState {
11
- #[ instrument( name = "spin_outbound_http.send_request" , skip_all, err ( level = Level :: INFO ) ,
11
+ #[ instrument( name = "spin_outbound_http.send_request" , skip_all,
12
12
fields( otel. kind = "client" , url. full = Empty , http. request. method = Empty ,
13
13
http. response. status_code = Empty , otel. name = Empty , server. address = Empty , server. port = Empty ) ) ]
14
14
async fn send_request ( & mut self , req : Request ) -> Result < Response , HttpError > {
@@ -116,6 +116,8 @@ fn record_request_fields(span: &Span, req: &Request) {
116
116
Method :: Head => "HEAD" ,
117
117
Method :: Options => "OPTIONS" ,
118
118
} ;
119
+ // Set otel.name to just the method name to fit with OpenTelemetry conventions
120
+ // <https://opentelemetry.io/docs/specs/semconv/http/http-spans/#name>
119
121
span. record ( "otel.name" , method)
120
122
. record ( "http.request.method" , method)
121
123
. record ( "url.full" , req. uri . clone ( ) ) ;
0 commit comments