network: add a metric+warning when shedding load

This commit is contained in:
Henry de Valence 2020-09-19 23:54:19 -07:00
parent fe61090a64
commit b72c249b96
1 changed files with 2 additions and 0 deletions

View File

@ -664,6 +664,8 @@ where
let rsp = match self.svc.call(req).await {
Err(e) => {
if e.is::<Overloaded>() {
tracing::warn!("inbound service is overloaded, closing connection");
metrics::counter!("pool.closed.loadshed", 1);
self.fail_with(PeerError::Overloaded);
} else {
// We could send a reject to the remote peer.