Outgoing Packet Metrics (#1980)

add tx/rx labels to packet counters and add metrics for outgoing packets
This commit is contained in:
Grant Limberg
2023-04-28 14:24:19 -07:00
committed by GitHub
parent e5fc89821f
commit 595e033776
7 changed files with 297 additions and 110 deletions

View File

@ -34,6 +34,7 @@
#include "SelfAwareness.hpp"
#include "Network.hpp"
#include "Trace.hpp"
#include "Metrics.hpp"
namespace ZeroTier {
@ -769,7 +770,6 @@ void Node::ncSendError(uint64_t nwid,uint64_t requestPacketId,const Address &des
break;
case NetworkController::NC_ERROR_AUTHENTICATION_REQUIRED: {
//fprintf(stderr, "\n\nGot auth required\n\n");
break;
}
@ -784,12 +784,15 @@ void Node::ncSendError(uint64_t nwid,uint64_t requestPacketId,const Address &des
//case NetworkController::NC_ERROR_INTERNAL_SERVER_ERROR:
default:
outp.append((unsigned char)Packet::ERROR_OBJ_NOT_FOUND);
Metrics::pkt_error_obj_not_found_out++;
break;
case NetworkController::NC_ERROR_ACCESS_DENIED:
outp.append((unsigned char)Packet::ERROR_NETWORK_ACCESS_DENIED_);
Metrics::pkt_error_network_access_denied_out++;
break;
case NetworkController::NC_ERROR_AUTHENTICATION_REQUIRED:
outp.append((unsigned char)Packet::ERROR_NETWORK_AUTHENTICATION_REQUIRED);
Metrics::pkt_error_authentication_required_out++;
break;
}