Quieten gossip republish logs (#5235)

* Quieten gossip republish logs
This commit is contained in:
Michael Sproul 2024-02-15 15:18:23 +11:00 committed by GitHub
parent 256d9042d3
commit 7c23625193
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1226,22 +1226,39 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
.publish(Topic::from(topic.clone()), data) .publish(Topic::from(topic.clone()), data)
{ {
Ok(_) => { Ok(_) => {
warn!(self.log, "Gossip message published on retry"; "topic" => topic_str); debug!(
if let Some(v) = metrics::get_int_counter( self.log,
"Gossip message published on retry";
"topic" => topic_str
);
metrics::inc_counter_vec(
&metrics::GOSSIP_LATE_PUBLISH_PER_TOPIC_KIND, &metrics::GOSSIP_LATE_PUBLISH_PER_TOPIC_KIND,
&[topic_str], &[topic_str],
) { );
v.inc()
};
} }
Err(e) => { Err(PublishError::Duplicate) => {
warn!(self.log, "Gossip message publish failed on retry"; "topic" => topic_str, "error" => %e); debug!(
if let Some(v) = metrics::get_int_counter( self.log,
"Gossip message publish ignored on retry";
"reason" => "duplicate",
"topic" => topic_str
);
metrics::inc_counter_vec(
&metrics::GOSSIP_FAILED_LATE_PUBLISH_PER_TOPIC_KIND, &metrics::GOSSIP_FAILED_LATE_PUBLISH_PER_TOPIC_KIND,
&[topic_str], &[topic_str],
) { );
v.inc() }
}; Err(e) => {
warn!(
self.log,
"Gossip message publish failed on retry";
"topic" => topic_str,
"error" => %e
);
metrics::inc_counter_vec(
&metrics::GOSSIP_FAILED_LATE_PUBLISH_PER_TOPIC_KIND,
&[topic_str],
);
} }
} }
} }