From 091469b9dc97ce8c60457dba1c7b4208c3f856f7 Mon Sep 17 00:00:00 2001 From: "Brian (Sunghoon) Cho" Date: Thu, 24 Aug 2023 17:46:36 -0700 Subject: [PATCH] [Mempool] reduce mempool log noise (#9767) ### Description Reduce the noise added by #9309. Make expected "errors" trace, and sample regardless. --- mempool/src/shared_mempool/network.rs | 2 +- mempool/src/shared_mempool/tasks.rs | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mempool/src/shared_mempool/network.rs b/mempool/src/shared_mempool/network.rs index 5869bcff63bfe..32f9a66f35a86 100644 --- a/mempool/src/shared_mempool/network.rs +++ b/mempool/src/shared_mempool/network.rs @@ -481,7 +481,7 @@ impl> MempoolNetworkInterf // Log all the metrics let latency = start_time.elapsed(); - debug!( + trace!( LogSchema::event_log(LogEntry::BroadcastTransaction, LogEvent::Success) .peer(&peer) .batch_id(&batch_id) diff --git a/mempool/src/shared_mempool/tasks.rs b/mempool/src/shared_mempool/tasks.rs index 83961d5f32955..d6069650ff377 100644 --- a/mempool/src/shared_mempool/tasks.rs +++ b/mempool/src/shared_mempool/tasks.rs @@ -69,8 +69,17 @@ pub(crate) async fn execute_broadcast( ) .peer(&peer) .error(&error)), + BroadcastError::NoTransactions(_) | BroadcastError::PeerNotPrioritized(_, _) => { + sample!( + SampleRate::Duration(Duration::from_secs(60)), + trace!("{:?}", err) + ); + }, _ => { - debug!("{:?}", err) + sample!( + SampleRate::Duration(Duration::from_secs(60)), + debug!("{:?}", err) + ); }, } }