feat(metrics): support arbitrary event tags and enhance monitoring coverage

Enable key-value metadata for events to track dry-run status and introduce new monitoring events for rate controller failure states.
This commit is contained in:
Nils Andreas Svee committed 2026-04-14 01:45:07 +07:00
1 parent 60e7ffc9e7
commit f8976a78a2
5 files changed
+27 -4

No files matched your search

+12
View File
@@ -339,6 +339,12 @@ impl Ratecontroller {
warn!(
"One or both Netlink stats could not be read. Skipping rate control algorithm"
);
self.metrics.send(Metric::Event {
name: "netlink_read_failure",
reason: "",
reflector: None,
tags: &[],
});
continue;
}
@@ -346,6 +352,12 @@ impl Ratecontroller {
if self.state_dl.deltas.is_empty() || self.state_ul.deltas.is_empty() {
warn!("No reflector data available, dropping to minimum rates");
self.metrics.send(Metric::Event {
name: "reflector_unavailable",
reason: "",
reflector: None,
tags: &[],
});
self.state_dl.next_rate = self.config.download_min_kbits;
self.state_ul.next_rate = self.config.upload_min_kbits;