Emit a structured `tracing` event for a single S3 API call. Hosts that want to meter S3 cost (call count, bytes transferred, latency) can subscribe to events from this module at `DEBUG` level and route on the `op` field. Fields emitted: | Field | Type | Meaning | |----------------|---------|--------------------------------------------
(
op: &'static str,
bucket: &str,
target: &str,
bytes: u64,
ok: bool,
elapsed: std::time::Duration,
)
| 1100 | /// |
| 1101 | /// Emitted at `DEBUG`; zero-cost when the level is disabled. |
| 1102 | fn emit_s3_call_event( |
| 1103 | op: &'static str, |
| 1104 | bucket: &str, |
| 1105 | target: &str, |
| 1106 | bytes: u64, |
| 1107 | ok: bool, |
| 1108 | elapsed: std::time::Duration, |
| 1109 | ) { |
| 1110 | tracing::debug!( |
| 1111 | op = op, |
| 1112 | bucket = %bucket, |
| 1113 | target = %target, |
| 1114 | bytes = bytes, |
| 1115 | outcome = if ok { "ok" } else { "error" }, |
| 1116 | duration_ms = elapsed.as_millis() as u64, |
| 1117 | ); |
| 1118 | } |
| 1119 | |
| 1120 | /// Map a `PutObject` failure to either a [`WorkspaceVersionConflict`] |
| 1121 | /// (HTTP 412 Precondition Failed from `If-Match`) or a generic write error. |
no outgoing calls
no test coverage detected