From ef0edbbf3cf7b3f832e96901dd97282eb9b18cc7 Mon Sep 17 00:00:00 2001 From: Benjamin Naecker Date: Fri, 19 Jul 2024 11:49:14 -0700 Subject: [PATCH] Use toml for mgd timeseries (#301) * Use TOML definitions of MGD timeseries * Remove unneeded stat definition macros --- Cargo.lock | 40 +++---- mg-common/src/lib.rs | 26 ----- mgd/src/oxstats.rs | 244 +++++++++++++++++++------------------------ 3 files changed, 125 insertions(+), 185 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf47aab7..b7878e89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,7 +119,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "api_identity" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "omicron-workspace-hack", "proc-macro2", @@ -941,7 +941,7 @@ dependencies = [ [[package]] name = "dns-service-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "anyhow", "chrono", @@ -994,7 +994,7 @@ dependencies = [ [[package]] name = "dropshot" version = "0.10.2-dev" -source = "git+https://github.com/oxidecomputer/dropshot?branch=main#fb254ad92bbbc29d249fa514486a9217d027f4a5" +source = "git+https://github.com/oxidecomputer/dropshot?branch=main#7b594d01f47ca783c5d4a25ca2b256602580fe92" dependencies = [ "async-stream", "async-trait", @@ -1040,7 +1040,7 @@ dependencies = [ [[package]] name = "dropshot_endpoint" version = "0.10.2-dev" -source = "git+https://github.com/oxidecomputer/dropshot?branch=main#fb254ad92bbbc29d249fa514486a9217d027f4a5" +source = "git+https://github.com/oxidecomputer/dropshot?branch=main#7b594d01f47ca783c5d4a25ca2b256602580fe92" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -1341,7 +1341,7 @@ dependencies = [ [[package]] name = "gateway-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "base64 0.22.1", "chrono", @@ -1744,7 +1744,7 @@ dependencies = [ [[package]] name = "internal-dns" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "anyhow", "chrono", @@ -2099,7 +2099,7 @@ dependencies = [ [[package]] name = "mg-admin-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/maghemite?rev=1b385990e8648b221fd11f018f2a7ec425461c6c#1b385990e8648b221fd11f018f2a7ec425461c6c" +source = "git+https://github.com/oxidecomputer/maghemite?rev=220dd026e83142b83bd93123f465a64dd4600201#220dd026e83142b83bd93123f465a64dd4600201" dependencies = [ "anyhow", "chrono", @@ -2344,7 +2344,7 @@ dependencies = [ [[package]] name = "nexus-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "chrono", "futures", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "nexus-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "anyhow", "api_identity", @@ -2579,7 +2579,7 @@ dependencies = [ [[package]] name = "omicron-common" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "anyhow", "api_identity", @@ -2593,7 +2593,7 @@ dependencies = [ "http 0.2.12", "ipnetwork", "macaddr", - "mg-admin-client 0.1.0 (git+https://github.com/oxidecomputer/maghemite?rev=1b385990e8648b221fd11f018f2a7ec425461c6c)", + "mg-admin-client 0.1.0 (git+https://github.com/oxidecomputer/maghemite?rev=220dd026e83142b83bd93123f465a64dd4600201)", "omicron-uuid-kinds", "omicron-workspace-hack", "once_cell", @@ -2621,7 +2621,7 @@ dependencies = [ [[package]] name = "omicron-passwords" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "argon2", "omicron-workspace-hack", @@ -2635,7 +2635,7 @@ dependencies = [ [[package]] name = "omicron-uuid-kinds" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "newtype-uuid", "paste", @@ -2802,7 +2802,7 @@ dependencies = [ [[package]] name = "oximeter" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "anyhow", "chrono", @@ -2820,7 +2820,7 @@ dependencies = [ [[package]] name = "oximeter-impl" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "bytes", "chrono", @@ -2848,7 +2848,7 @@ dependencies = [ [[package]] name = "oximeter-macro-impl" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "omicron-workspace-hack", "proc-macro2", @@ -2859,7 +2859,7 @@ dependencies = [ [[package]] name = "oximeter-producer" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "chrono", "dropshot", @@ -2880,7 +2880,7 @@ dependencies = [ [[package]] name = "oximeter-timeseries-macro" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "omicron-workspace-hack", "oximeter-impl", @@ -2892,7 +2892,7 @@ dependencies = [ [[package]] name = "oxnet" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/oxnet#2612d2203effcfdcbf83778a77f1bfd03fe6ed24" +source = "git+https://github.com/oxidecomputer/oxnet#7dacd265f1bcd0f8b47bd4805250c4f0812da206" dependencies = [ "ipnetwork", "schemars", @@ -4060,7 +4060,7 @@ dependencies = [ [[package]] name = "sled-agent-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/omicron?branch=main#8316247eaf4c629301be3bbafaa8c77aca93eb13" +source = "git+https://github.com/oxidecomputer/omicron?branch=main#c5ed4de5cd2b667cc4b46520e19bc036da8d63ab" dependencies = [ "anyhow", "async-trait", diff --git a/mg-common/src/lib.rs b/mg-common/src/lib.rs index 1f9e2497..c7024822 100644 --- a/mg-common/src/lib.rs +++ b/mg-common/src/lib.rs @@ -28,29 +28,3 @@ macro_rules! write_lock { $rwl.write().expect("rwlock write") }; } - -// -// stats macros -// - -#[macro_export] -macro_rules! counter { - ($name:ident) => { - #[derive(Clone, Copy, Debug, Default, Metric)] - pub struct $name { - #[datum] - count: Cumulative, - } - }; -} - -#[macro_export] -macro_rules! quantity { - ($name:ident, $kind:tt) => { - #[derive(Clone, Copy, Debug, Default, Metric)] - pub struct $name { - #[datum] - quantity: $kind, - } - }; -} diff --git a/mgd/src/oxstats.rs b/mgd/src/oxstats.rs index 293aa6cb..e233b712 100644 --- a/mgd/src/oxstats.rs +++ b/mgd/src/oxstats.rs @@ -9,21 +9,76 @@ use chrono::{DateTime, Utc}; use dropshot::{ConfigLogging, ConfigLoggingLevel}; use mg_common::nexus::{local_underlay_address, resolve_nexus, run_oximeter}; use mg_common::stats::MgLowerStats; -use mg_common::{counter, quantity}; use omicron_common::api::internal::nexus::{ProducerEndpoint, ProducerKind}; use oximeter::types::{Cumulative, ProducerRegistry}; -use oximeter::{Metric, MetricsError, Producer, Sample, Target}; +use oximeter::{MetricsError, Producer, Sample}; use oximeter_producer::LogConfig; use rdb::Db; use slog::{warn, Logger}; use std::collections::BTreeMap; -use std::net::{IpAddr, SocketAddr}; +use std::net::SocketAddr; use std::sync::atomic::Ordering; use std::sync::Arc; use std::time::Duration; use tokio::task::JoinHandle; use uuid::Uuid; +oximeter::use_timeseries!("bfd-session.toml"); +use bfd_session::BfdSession; +use bfd_session::ControlPacketSendFailures; +use bfd_session::ControlPacketsReceived; +use bfd_session::ControlPacketsSent; +use bfd_session::MessageReceiveError; +use bfd_session::TimeoutExpired; +use bfd_session::TransitionToDown; +use bfd_session::TransitionToInit; +use bfd_session::TransitionToUp; + +oximeter::use_timeseries!("bgp-session.toml"); +use bgp_session::ActiveConnectionsAccepted; +use bgp_session::BgpSession; +use bgp_session::ConnectionRetries; +use bgp_session::HoldTimerExpirations; +use bgp_session::IdleHoldTimerExpirations; +use bgp_session::KeepaliveSendFailures; +use bgp_session::KeepalivesReceived; +use bgp_session::KeepalivesSent; +use bgp_session::NotificationSendFailures; +use bgp_session::OpenHandleFailures; +use bgp_session::OpenSendFailures; +use bgp_session::OpensReceived; +use bgp_session::OpensSent; +use bgp_session::PassiveConnectionsAccepted; +use bgp_session::PrefixesAdvertised; +use bgp_session::PrefixesImported; +use bgp_session::TransitionToActive; +use bgp_session::TransitionToConnect; +use bgp_session::TransitionToEstablished; +use bgp_session::TransitionToIdle; +use bgp_session::TransitionToOpenConfirm; +use bgp_session::TransitionToOpenSent; +use bgp_session::TransitionToSessionSetup; +use bgp_session::UnexpectedKeepaliveMessages; +use bgp_session::UnexpectedOpenMessages; +use bgp_session::UnexpectedUpdateMessages; +use bgp_session::UpdateNexthopMissing; +use bgp_session::UpdateSendFailures; +use bgp_session::UpdatesReceived; +use bgp_session::UpdatesSent; + +oximeter::use_timeseries!("static-routing-config.toml"); +use static_routing_config::StaticNexthops; +use static_routing_config::StaticRoutes; +use static_routing_config::StaticRoutingConfig; + +oximeter::use_timeseries!("mg-lower.toml"); +use self::mg_lower::MgLower; +use self::mg_lower::RoutesBlockedByLinkState; + +oximeter::use_timeseries!("switch-rib.toml"); +use switch_rib::ActiveRoutes; +use switch_rib::SwitchRib; + #[derive(Clone)] pub(crate) struct Stats { pub(crate) hostname: String, @@ -37,44 +92,6 @@ pub(crate) struct Stats { log: Logger, } -#[derive(Debug, Clone, Target)] -struct BgpSession { - rack_id: Uuid, - sled_id: Uuid, - hostname: String, - local_asn: u32, - peer: IpAddr, -} - -#[derive(Debug, Clone, Target)] -struct BfdSession { - rack_id: Uuid, - sled_id: Uuid, - hostname: String, - peer: IpAddr, -} - -#[derive(Debug, Clone, Target)] -struct StaticRoutingConfig { - rack_id: Uuid, - sled_id: Uuid, - hostname: String, -} - -#[derive(Debug, Clone, Target)] -struct SwitchRib { - rack_id: Uuid, - sled_id: Uuid, - hostname: String, -} - -#[derive(Debug, Clone, Target)] -struct MgLower { - rack_id: Uuid, - sled_id: Uuid, - hostname: String, -} - macro_rules! bgp_session_counter { ( $hostname:expr, @@ -95,7 +112,7 @@ macro_rules! bgp_session_counter { peer: $peer, }, &$kind { - count: Cumulative::::with_start_time( + datum: Cumulative::::with_start_time( $start_time, $value.load(Ordering::Relaxed), ), @@ -122,7 +139,7 @@ macro_rules! bfd_session_counter { peer: $peer, }, &$kind { - count: Cumulative::::with_start_time( + datum: Cumulative::::with_start_time( $start_time, $value.load(Ordering::Relaxed), ), @@ -147,7 +164,7 @@ macro_rules! static_counter { sled_id: $sled_id, }, &$kind { - count: Cumulative::::with_start_time($start_time, $value), + datum: Cumulative::::with_start_time($start_time, $value), }, )? }; @@ -169,7 +186,7 @@ macro_rules! mg_lower_quantity { sled_id: $sled_id, }, &$kind { - quantity: $value.load(Ordering::Relaxed), + datum: $value.load(Ordering::Relaxed), }, )? }; @@ -190,62 +207,11 @@ macro_rules! rib_quantity { rack_id: $rack_id, sled_id: $sled_id, }, - &$kind { quantity: $value }, + &$kind { datum: $value }, )? }; } -// BGP -counter!(KeepalivesSent); -counter!(KeepalivesReceived); -counter!(OpensSent); -counter!(OpensReceived); -counter!(UpdatesSent); -counter!(UpdatesReceived); -counter!(PrefixesAdvertised); -counter!(PrefixesImported); -counter!(IdleHoldTimerExpirations); -counter!(HoldTimerExpirations); -counter!(UnexpectedKeepaliveMessages); -counter!(UnexpectedOpenMessages); -counter!(UnexpectedUpdateMessages); -counter!(UpdateNexthopMissing); -counter!(ActiveConnectionsAccepted); -counter!(PassiveConnectionsAccepted); -counter!(ConnectionRetries); -counter!(OpenHandleFailures); -counter!(TransitionToIdle); -counter!(TransitionToConnect); -counter!(TransitionToActive); -counter!(TransitionToOpenSent); -counter!(TransitionToOpenConfirm); -counter!(TransitionToSessionSetup); -counter!(TransitionToEstablished); -counter!(NotificationSendFailures); -counter!(OpenSendFailures); -counter!(KeepaliveSendFailures); -counter!(UpdateSendFailures); - -// BFD -counter!(ControlPacketsSent); -counter!(ControlPacketSendFailures); -counter!(ControlPacketsReceived); -counter!(TransitionToInit); -counter!(TransitionToDown); -counter!(TransitionToUp); -counter!(TimeoutExpired); -counter!(MessageRecieveError); - -// Static -counter!(StaticRoutes); -counter!(StaticNexthops); - -// RIB -quantity!(ActiveRoutes, u64); - -// Mg-lower -quantity!(RoutesBlockedByLinkState, u64); - impl std::fmt::Debug for Stats { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str("stats")?; @@ -319,7 +285,7 @@ impl Stats { for (asn, session_counters) in &router_counters { for (addr, counters) in session_counters { samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -329,7 +295,7 @@ impl Stats { counters.keepalives_sent )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -339,7 +305,7 @@ impl Stats { counters.keepalives_received )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -349,7 +315,7 @@ impl Stats { counters.opens_sent )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -359,7 +325,7 @@ impl Stats { counters.opens_received )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -369,7 +335,7 @@ impl Stats { counters.updates_sent )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -379,7 +345,7 @@ impl Stats { counters.updates_received )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -389,7 +355,7 @@ impl Stats { counters.prefixes_advertised )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -399,7 +365,7 @@ impl Stats { counters.prefixes_imported )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -409,7 +375,7 @@ impl Stats { counters.idle_hold_timer_expirations )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -419,7 +385,7 @@ impl Stats { counters.hold_timer_expirations )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -429,7 +395,7 @@ impl Stats { counters.update_nexhop_missing )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -439,7 +405,7 @@ impl Stats { counters.active_connections_accepted )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -449,7 +415,7 @@ impl Stats { counters.passive_connections_accepted )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -459,7 +425,7 @@ impl Stats { counters.connection_retries )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -469,7 +435,7 @@ impl Stats { counters.open_handle_failures )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -479,7 +445,7 @@ impl Stats { counters.transitions_to_idle )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -489,7 +455,7 @@ impl Stats { counters.transitions_to_connect )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -499,7 +465,7 @@ impl Stats { counters.transitions_to_active )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -509,7 +475,7 @@ impl Stats { counters.transitions_to_open_sent )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -519,7 +485,7 @@ impl Stats { counters.transitions_to_open_confirm )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -529,7 +495,7 @@ impl Stats { counters.transitions_to_session_setup )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -539,7 +505,7 @@ impl Stats { counters.transitions_to_established )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -549,7 +515,7 @@ impl Stats { counters.unexpected_update_message )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -559,7 +525,7 @@ impl Stats { counters.unexpected_keepalive_message )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -569,7 +535,7 @@ impl Stats { counters.unexpected_open_message )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -579,7 +545,7 @@ impl Stats { counters.notification_send_failure )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -589,7 +555,7 @@ impl Stats { counters.keepalive_send_failure )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -599,7 +565,7 @@ impl Stats { counters.open_send_failure )); samples.push(bgp_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -626,7 +592,7 @@ impl Stats { for (addr, counters) in &counters { samples.push(bfd_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -635,7 +601,7 @@ impl Stats { counters.control_packets_sent )); samples.push(bfd_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -644,7 +610,7 @@ impl Stats { counters.control_packet_send_failures )); samples.push(bfd_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -653,7 +619,7 @@ impl Stats { counters.control_packets_received )); samples.push(bfd_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -662,7 +628,7 @@ impl Stats { counters.transition_to_init )); samples.push(bfd_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -671,7 +637,7 @@ impl Stats { counters.transition_to_down )); samples.push(bfd_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -680,7 +646,7 @@ impl Stats { counters.transition_to_up )); samples.push(bfd_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -689,12 +655,12 @@ impl Stats { counters.timeout_expired )); samples.push(bfd_session_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, *addr, - MessageRecieveError, + MessageReceiveError, counters.message_receive_error )); } @@ -708,7 +674,7 @@ impl Stats { match self.db.get_static4_count() { Ok(count) => { samples.push(static_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -723,7 +689,7 @@ impl Stats { match self.db.get_static_nexthop4_count() { Ok(count) => { samples.push(static_counter!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -747,7 +713,7 @@ impl Stats { count += paths.len(); } samples.push(rib_quantity!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time, @@ -760,7 +726,7 @@ impl Stats { fn mg_lower_stats(&mut self) -> Result, MetricsError> { Ok(vec![mg_lower_quantity!( - self.hostname.clone(), + self.hostname.clone().into(), self.rack_id, self.sled_id, self.start_time,