fix(logging): bound hot-path span amplification (#5763)

* fix(logging): bound hot-path span amplification

* refactor(logging): reuse HTTP log target constant

Co-Authored-By: heihutu <heihutu@gmail.com>

---------

Co-authored-by: Anthony Martin <949506+anthonymartin@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
anthonymartin
2026-08-06 07:29:18 -07:00
committed by GitHub
parent 87d32a6207
commit 656a2f14bf
14 changed files with 211 additions and 22 deletions
+1 -1
View File
@@ -2550,7 +2550,7 @@ impl DefaultBucketUsecase {
Ok(S3Response::new(PutBucketVersioningOutput {}))
}
#[instrument(level = "info", skip(self, req))]
#[instrument(level = "trace", skip(self, req))]
pub async fn execute_list_objects_v2(&self, req: S3Request<ListObjectsV2Input>) -> S3Result<S3Response<ListObjectsV2Output>> {
// warn!("list_objects_v2 req {:?}", &req.input);
let ListObjectsV2Input {
+4
View File
@@ -35,6 +35,7 @@ use http_body_util::{BodyExt, Full};
use hyper::body::Incoming;
use pin_project_lite::pin_project;
use quick_xml::events::Event;
use rustfs_obs::HTTP_SERVER_LOG_TARGET;
#[cfg(feature = "swift")]
use rustfs_protocols::swift::SwiftRouter;
use rustfs_trusted_proxies::ClientInfo;
@@ -391,6 +392,7 @@ impl RequestLogContext {
if status.is_server_error() {
error!(
target: HTTP_SERVER_LOG_TARGET,
event = HTTP_REQUEST_COMPLETED_EVENT,
component = LOG_COMPONENT_SERVER,
subsystem = LOG_SUBSYSTEM_HTTP,
@@ -407,6 +409,7 @@ impl RequestLogContext {
);
} else {
info!(
target: HTTP_SERVER_LOG_TARGET,
event = HTTP_REQUEST_COMPLETED_EVENT,
component = LOG_COMPONENT_SERVER,
subsystem = LOG_SUBSYSTEM_HTTP,
@@ -429,6 +432,7 @@ impl RequestLogContext {
E: std::fmt::Display,
{
error!(
target: HTTP_SERVER_LOG_TARGET,
event = HTTP_REQUEST_FAILED_EVENT,
component = LOG_COMPONENT_SERVER,
subsystem = LOG_SUBSYSTEM_HTTP,