chore: Update the ByteSize crate version we're using

This commit is contained in:
Damir Jelić
2025-04-09 11:43:41 +02:00
parent 1d3107ebcb
commit f4eea708fa
5 changed files with 9 additions and 6 deletions

4
Cargo.lock generated
View File

@@ -620,9 +620,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b"
[[package]]
name = "bytesize"
version = "1.3.0"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc"
checksum = "a3c8f83209414aacf0eeae3cf730b18d6981697fba62f200fcfb92b9f082acba"
[[package]]
name = "camino"

View File

@@ -60,7 +60,7 @@ async-stream = { workspace = true }
async-trait = { workspace = true }
axum = { version = "0.8.1", optional = true }
bytes = "1.9.0"
bytesize = "1.3.0"
bytesize = "2.0.1"
event-listener = "5.4.0"
eyeball = { workspace = true }
eyeball-im = { workspace = true }

View File

@@ -204,7 +204,10 @@ impl HttpClient {
// in conjunction with request bodies
if [Method::POST, Method::PUT, Method::PATCH].contains(method) {
let request_size = request.body().len().try_into().unwrap_or(u64::MAX);
span.record("request_size", ByteSize(request_size).to_string_as(true));
span.record(
"request_size",
ByteSize(request_size).display().si_short().to_string(),
);
}
request

View File

@@ -94,7 +94,7 @@ impl HttpClient {
let response_size = ByteSize(response.body().len().try_into().unwrap_or(u64::MAX));
tracing::Span::current()
.record("status", status_code.as_u16())
.record("response_size", response_size.to_string_as(true));
.record("response_size", response_size.display().si_short().to_string());
// Record interesting headers. If you add more headers, ensure they're not
// confidential.

View File

@@ -42,7 +42,7 @@ impl HttpClient {
let response_size = ByteSize(response.body().len().try_into().unwrap_or(u64::MAX));
tracing::Span::current()
.record("status", status_code.as_u16())
.record("response_size", response_size.to_string_as(true));
.record("response_size", response_size.display().si_short().to_string());
Ok(R::IncomingResponse::try_from_http_response(response)?)
}