This commit is contained in:
parent
0a54e7aefa
commit
efa1d019f6
20
src/lib.rs
20
src/lib.rs
|
@ -124,19 +124,19 @@ where
|
|||
|
||||
match request_head.version {
|
||||
actix_http::Version::HTTP_09 => {
|
||||
span.record("http.flavor", &"0.9");
|
||||
span.record("http.flavor", "0.9");
|
||||
}
|
||||
actix_http::Version::HTTP_10 => {
|
||||
span.record("http.flavor", &"1.0");
|
||||
span.record("http.flavor", "1.0");
|
||||
}
|
||||
actix_http::Version::HTTP_11 => {
|
||||
span.record("http.flavor", &"1.1");
|
||||
span.record("http.flavor", "1.1");
|
||||
}
|
||||
actix_http::Version::HTTP_2 => {
|
||||
span.record("http.flavor", &"2.0");
|
||||
span.record("http.flavor", "2.0");
|
||||
}
|
||||
actix_http::Version::HTTP_3 => {
|
||||
span.record("http.flavor", &"3.0");
|
||||
span.record("http.flavor", "3.0");
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
@ -193,9 +193,9 @@ where
|
|||
.map_ok(|succ| match succ {
|
||||
ConnectResponse::Client(client_response) => {
|
||||
let status: i32 = client_response.status().as_u16().into();
|
||||
span.record("http.status_code", &status);
|
||||
span.record("http.status_code", status);
|
||||
if client_response.status().is_client_error() {
|
||||
span.record("otel.status_code", &"ERROR");
|
||||
span.record("otel.status_code", "ERROR");
|
||||
}
|
||||
|
||||
ConnectResponse::Client(client_response.map_body(|_, payload| {
|
||||
|
@ -208,15 +208,15 @@ where
|
|||
}
|
||||
ConnectResponse::Tunnel(response_head, etc) => {
|
||||
let status: i32 = response_head.status.as_u16().into();
|
||||
span.record("http.status_code", &status);
|
||||
span.record("http.status_code", status);
|
||||
if response_head.status.is_client_error() {
|
||||
span.record("otel.status_code", &"ERROR");
|
||||
span.record("otel.status_code", "ERROR");
|
||||
}
|
||||
ConnectResponse::Tunnel(response_head, etc)
|
||||
}
|
||||
})
|
||||
.map_err(|err| {
|
||||
span.record("otel.status_code", &"ERROR");
|
||||
span.record("otel.status_code", "ERROR");
|
||||
span.record(
|
||||
"exception.message",
|
||||
&tracing::field::display(&format!("{}", err)),
|
||||
|
|
Loading…
Reference in a new issue