File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -222,15 +222,25 @@ impl Starting {
222
222
"mcp_server" ,
223
223
method = %request. method( ) ,
224
224
uri = %request. uri( ) ,
225
- session_id = %request . headers ( ) . get ( "mcp-session-id" ) . and_then ( |v| v . to_str ( ) . ok ( ) ) . unwrap_or ( "" ) ,
225
+ session_id = tracing :: field :: Empty ,
226
226
status_code = tracing:: field:: Empty ,
227
227
)
228
228
} )
229
229
. on_response (
230
230
|response : & axum:: http:: Response < _ > ,
231
231
_latency : std:: time:: Duration ,
232
232
span : & tracing:: Span | {
233
- span. record ( "status" , tracing:: field:: display ( response. status ( ) ) ) ;
233
+ span. record (
234
+ "status_code" ,
235
+ tracing:: field:: display ( response. status ( ) ) ,
236
+ ) ;
237
+ if let Some ( session_id) = response
238
+ . headers ( )
239
+ . get ( "mcp-session-id" )
240
+ . and_then ( |v| v. to_str ( ) . ok ( ) )
241
+ {
242
+ span. record ( "session_id" , tracing:: field:: display ( session_id) ) ;
243
+ }
234
244
} ,
235
245
) ,
236
246
) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ impl TelemetryAttribute {
32
32
TelemetryAttribute :: SessionId => {
33
33
Key :: from_static_str ( TelemetryAttribute :: SessionId . as_str ( ) )
34
34
}
35
+ TelemetryAttribute :: StatusCode => {
36
+ Key :: from_static_str ( TelemetryAttribute :: StatusCode . as_str ( ) )
37
+ }
35
38
}
36
39
}
37
40
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ raw_operation = "Graphql operation text and metadata used for Tool generation"
8
8
client_name = " The client name that initializes with the MCP Server"
9
9
client_version = " The client version that initializes with the MCP Server"
10
10
session_id = " The value of the Mcp-Session-Id header in the HTTP request"
11
+ status_code = " The HTTP status code returned by requests using the Streamable HTTP Transport"
11
12
12
13
[metrics .apollo .mcp ]
13
14
"initialize.count" = " Number of times initialize has been called"
You can’t perform that action at this time.
0 commit comments