diff --git a/node/Metrics.cpp b/node/Metrics.cpp index b3bec9fe8..e0fbad9d8 100644 --- a/node/Metrics.cpp +++ b/node/Metrics.cpp @@ -172,12 +172,10 @@ namespace ZeroTier { prometheus::simpleapi::gauge_metric_t network_num_joined { "zt_num_networks", "number of networks this instance is joined to" }; prometheus::simpleapi::gauge_family_t network_num_multicast_groups - { "zt_network_multcast_groups_subscribed", "number of multicast groups networks are subscribed to" }; - prometheus::simpleapi::counter_family_t network_incoming_packets - { "zt_network_incoming_packets", "number of incoming packets per network" }; - prometheus::simpleapi::counter_family_t network_outgoing_packets - { "zt_network_outgoing_packets", "number of outgoing packets per network" }; - + { "zt_network_multicast_groups_subscribed", "number of multicast groups networks are subscribed to" }; + prometheus::simpleapi::counter_family_t network_packets + { "zt_network_packets", "number of incoming/outgoing packets per network" }; + // PeerMetrics prometheus::CustomFamily> &peer_latency = prometheus::Builder>() diff --git a/node/Metrics.hpp b/node/Metrics.hpp index 3765e890f..6d015c36d 100644 --- a/node/Metrics.hpp +++ b/node/Metrics.hpp @@ -105,8 +105,7 @@ namespace ZeroTier { // Network Metrics extern prometheus::simpleapi::gauge_metric_t network_num_joined; extern prometheus::simpleapi::gauge_family_t network_num_multicast_groups; - extern prometheus::simpleapi::counter_family_t network_incoming_packets; - extern prometheus::simpleapi::counter_family_t network_outgoing_packets; + extern prometheus::simpleapi::counter_family_t network_packets; // Peer Metrics extern prometheus::CustomFamily> &peer_latency; diff --git a/node/Network.cpp b/node/Network.cpp index 10436aedb..1e77e4636 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -569,10 +569,10 @@ Network::Network(const RuntimeEnvironment *renv,void *tPtr,uint64_t nwid,void *u _netconfFailure(NETCONF_FAILURE_NONE), _portError(0), _num_multicast_groups{Metrics::network_num_multicast_groups.Add({{"network_id", _nwidStr}})}, - _incoming_packets_accpeted{Metrics::network_incoming_packets.Add({{"network_id", _nwidStr},{"accepted","yes"}})}, - _incoming_packets_dropped{Metrics::network_incoming_packets.Add({{"network_id", _nwidStr},{"accepted","no"}})}, - _outgoing_packets_accepted{Metrics::network_outgoing_packets.Add({{"network_id", _nwidStr},{"accepted","yes"}})}, - _outgoing_packets_dropped{Metrics::network_outgoing_packets.Add({{"network_id", _nwidStr},{"accepted","no"}})} + _incoming_packets_accepted{Metrics::network_packets.Add({{"direction","rx"},{"network_id", _nwidStr},{"accepted","yes"}})}, + _incoming_packets_dropped{Metrics::network_packets.Add({{"direction","rx"},{"network_id", _nwidStr},{"accepted","no"}})}, + _outgoing_packets_accepted{Metrics::network_packets.Add({{"direction","tx"},{"network_id", _nwidStr},{"accepted","yes"}})}, + _outgoing_packets_dropped{Metrics::network_packets.Add({{"direction","tx"},{"network_id", _nwidStr},{"accepted","no"}})} { for(int i=0;iidentity.address(),Packet::VERB_EXT_FRAME); outp.append(_id); diff --git a/node/Network.hpp b/node/Network.hpp index 676e5556e..a3bce14af 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -483,7 +483,7 @@ private: AtomicCounter __refCount; prometheus::simpleapi::gauge_metric_t _num_multicast_groups; - prometheus::simpleapi::counter_metric_t _incoming_packets_accpeted; + prometheus::simpleapi::counter_metric_t _incoming_packets_accepted; prometheus::simpleapi::counter_metric_t _incoming_packets_dropped; prometheus::simpleapi::counter_metric_t _outgoing_packets_accepted; prometheus::simpleapi::counter_metric_t _outgoing_packets_dropped;