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)
{
Ok(_) => {
warn!(self.log, "Gossip message published on retry"; "topic" => topic_str);
if let Some(v) = metrics::get_int_counter(
debug!(
self.log,
"Gossip message published on retry";
"topic" => topic_str
);
metrics::inc_counter_vec(
&metrics::GOSSIP_LATE_PUBLISH_PER_TOPIC_KIND,
&[topic_str],
) {
v.inc()
};
);
}
Err(e) => {
warn!(self.log, "Gossip message publish failed on retry"; "topic" => topic_str, "error" => %e);
if let Some(v) = metrics::get_int_counter(
Err(PublishError::Duplicate) => {
debug!(
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,
&[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],
);
}
}
}