Further collapse tcp & udp into metric labels for zt_data

This commit is contained in:
Grant Limberg 2023-05-04 08:27:36 -07:00
parent dc2ab00564
commit 96ab0bab43
No known key found for this signature in database
GPG key ID: 8F2F97D3BE8D7735
2 changed files with 7 additions and 10 deletions

View file

@ -157,18 +157,16 @@ namespace ZeroTier {
{ packet_errors.Add({{"error_type", "internal_server_error"}, {"direction", "tx"}}) };
// Data Sent/Received Metrics
prometheus::simpleapi::counter_family_t udp
{ "zt_udp_data", "number of bytes ZeroTier has transmitted or received via UDP" };
prometheus::simpleapi::counter_family_t data
{ "zt_data", "number of bytes ZeroTier has transmitted or received via UDP" };
prometheus::simpleapi::counter_metric_t udp_recv
{ udp.Add({{"direction","rx"}}) };
{ data.Add({{"protocol","udp"},{"direction","rx"}}) };
prometheus::simpleapi::counter_metric_t udp_send
{ udp.Add({{"direction","tx"}}) };
prometheus::simpleapi::counter_family_t tcp
{ "zt_tcp_data", "number of bytes ZeroTier has transmitted or received via TCP" };
{ data.Add({{"protocol","udp"},{"direction","tx"}}) };
prometheus::simpleapi::counter_metric_t tcp_send
{ tcp.Add({{"direction", "tx"}}) };
{ data.Add({{"protocol","tcp"},{"direction", "tx"}}) };
prometheus::simpleapi::counter_metric_t tcp_recv
{ tcp.Add({{"direction", "rx"}}) };
{ data.Add({{"protocol","tcp"},{"direction", "rx"}}) };
// Network Metrics
prometheus::simpleapi::gauge_metric_t network_num_joined

View file

@ -96,10 +96,9 @@ namespace ZeroTier {
extern prometheus::simpleapi::counter_metric_t pkt_error_internal_server_error_out;
// Data Sent/Received Metrics
extern prometheus::simpleapi::counter_family_t udp;
extern prometheus::simpleapi::counter_family_t data;
extern prometheus::simpleapi::counter_metric_t udp_send;
extern prometheus::simpleapi::counter_metric_t udp_recv;
extern prometheus::simpleapi::counter_family_t tcp;
extern prometheus::simpleapi::counter_metric_t tcp_send;
extern prometheus::simpleapi::counter_metric_t tcp_recv;