Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion linera-rpc/src/grpc/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ mod metrics {
&[],
)
});

pub static NOTIFICATIONS_SKIPPED_RECEIVER_LAG: LazyLock<IntCounterVec> = LazyLock::new(|| {
register_int_counter_vec(
"notifications_skipped_receiver_lag",
"Number of notifications skipped because receiver lagged behind sender",
&[],
)
});

pub static NOTIFICATIONS_DROPPED_NO_RECEIVER: LazyLock<IntCounterVec> = LazyLock::new(|| {
register_int_counter_vec(
"notifications_dropped_no_receiver",
"Number of notifications dropped because no receiver was available",
&[],
)
});
}

#[derive(Clone)]
Expand Down Expand Up @@ -320,6 +336,10 @@ where
nickname,
skipped_count, "notification receiver lagged, messages were skipped"
);
#[cfg(with_metrics)]
metrics::NOTIFICATIONS_SKIPPED_RECEIVER_LAG
.with_label_values(&[])
.inc_by(skipped_count);
continue;
}
Err(RecvError::Closed) => {
Expand Down Expand Up @@ -395,7 +415,10 @@ where
trace!("Scheduling notification query");
if let Err(error) = notification_sender.send(notification) {
error!(%error, "dropping notification");
break;
#[cfg(with_metrics)]
metrics::NOTIFICATIONS_DROPPED_NO_RECEIVER
.with_label_values(&[])
.inc();
}
}
}
Expand Down
Loading