Skip to content

Commit 345336f

Browse files
[faucet] Do not log 429 errors (#20930)
## Description This PR updates the logging of 429 errors, to skip them as it floods the logs with them after rate limiting the server. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
1 parent c8726b3 commit 345336f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

crates/sui-faucet/src/metrics_layer.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,13 @@ impl MetricsGuard {
175175
self.path, elapsed, err
176176
);
177177
} else if let Some(status) = status {
178-
error!(
179-
"Request failed for path {} in {:.2}s with status: {}",
180-
self.path, elapsed, status
181-
);
178+
// don't log too many requests as an error, as we're flooding the logs
179+
if status != StatusCode::TOO_MANY_REQUESTS {
180+
error!(
181+
"Request failed for path {} in {:.2}s with status: {}",
182+
self.path, elapsed, status
183+
);
184+
}
182185
} else {
183186
warn!("Request failed for path {} in {:.2}s", self.path, elapsed);
184187
}

0 commit comments

Comments
 (0)