network: add a metric+warning when shedding load
This commit is contained in:
parent
fe61090a64
commit
b72c249b96
|
|
@ -664,6 +664,8 @@ where
|
||||||
let rsp = match self.svc.call(req).await {
|
let rsp = match self.svc.call(req).await {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
if e.is::<Overloaded>() {
|
if e.is::<Overloaded>() {
|
||||||
|
tracing::warn!("inbound service is overloaded, closing connection");
|
||||||
|
metrics::counter!("pool.closed.loadshed", 1);
|
||||||
self.fail_with(PeerError::Overloaded);
|
self.fail_with(PeerError::Overloaded);
|
||||||
} else {
|
} else {
|
||||||
// We could send a reject to the remote peer.
|
// We could send a reject to the remote peer.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue