mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-10-23 14:02:21 +00:00
Add metric for unfeasbile update to unknown subnet
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
3 files changed
+17
No files matched your search
@@ -29,6 +29,7 @@ pub struct PrometheusExporter {
|
||||
router_propage_selected_peers_time_spent: IntCounter,
|
||||
router_update_skipped_route_selection: IntCounter,
|
||||
router_update_denied_by_filter: IntCounter,
|
||||
router_update_not_interested: IntCounter,
|
||||
peer_manager_peer_added: IntCounterVec,
|
||||
peer_manager_known_peers: IntGauge,
|
||||
peer_manager_connection_attemps: IntCounterVec,
|
||||
@@ -137,6 +138,11 @@ impl PrometheusExporter {
|
||||
"Updates which were received and immediately denied by a configured filter",
|
||||
)
|
||||
.expect("Can register an int counter in default registry"),
|
||||
router_update_not_interested: register_int_counter!(
|
||||
"mycelium_router_update_not_interested",
|
||||
"Updates which were allowed by the configured filters, but not of interest as they were either not feasible, or retractions, for an unknown subnet",
|
||||
)
|
||||
.expect("Can register an int counter in default registry"),
|
||||
peer_manager_peer_added: register_int_counter_vec!(
|
||||
opts!(
|
||||
"mycelium_peer_manager_peers_added",
|
||||
@@ -385,6 +391,11 @@ impl Metrics for PrometheusExporter {
|
||||
self.router_update_denied_by_filter.inc()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn router_update_not_interested(&self) {
|
||||
self.router_update_not_interested.inc()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn peer_manager_peer_added(&self, pt: mycelium::peer_manager::PeerType) {
|
||||
let label = match pt {
|
||||
|
||||
@@ -163,6 +163,11 @@ pub trait Metrics {
|
||||
#[inline]
|
||||
fn router_update_denied_by_filter(&self) {}
|
||||
|
||||
/// An update was accepted by the router filters, but was otherwise unfeasible or a retraction,
|
||||
/// for an unknown subnet.
|
||||
#[inline]
|
||||
fn router_update_not_interested(&self) {}
|
||||
|
||||
/// A new [`Peer`](crate::peer::Peer) was added to the
|
||||
/// [`PeerManager`](crate::peer_manager::PeerManager) while it is running.
|
||||
#[inline]
|
||||
|
||||
@@ -989,6 +989,7 @@ where
|
||||
} else {
|
||||
if !update_feasible || metric.is_infinite() {
|
||||
debug!(%subnet, "Ignore unfeasible update | retraction for unknown subnet");
|
||||
self.metrics.router_update_not_interested();
|
||||
return;
|
||||
}
|
||||
let ss = self.node_keypair.0.shared_secret(&router_id.to_pubkey());
|
||||
|
||||
Reference in new issue
Block a user