mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
still blows up but adding to the record for completeness right now
This commit is contained in:
parent
d10ceac76a
commit
1bb3d86e10
3 changed files with 62 additions and 32 deletions
45
node/Metrics.cpp
Normal file
45
node/Metrics.cpp
Normal file
|
@ -0,0 +1,45 @@
|
|||
#include <prometheus/simpleapi.h>
|
||||
|
||||
namespace ZeroTier {
|
||||
namespace Metrics {
|
||||
// General Controller Metrics
|
||||
prometheus::simpleapi::gauge_metric_t network_count
|
||||
{"controller_network_count", "number of networks the controller is serving"};
|
||||
prometheus::simpleapi::gauge_metric_t member_count
|
||||
{"controller_member_count", "number of network members the controller is serving"};
|
||||
prometheus::simpleapi::counter_metric_t network_changes
|
||||
{"controller_network_change_count", "number of times a network configuration is changed"};
|
||||
prometheus::simpleapi::counter_metric_t member_changes
|
||||
{"controller_member_change_count", "number of times a network member configuration is changed"};
|
||||
prometheus::simpleapi::counter_metric_t member_auths
|
||||
{"controller_member_auth_count", "number of network member auths"};
|
||||
prometheus::simpleapi::counter_metric_t member_deauths
|
||||
{"controller_member_deauth_count", "number of network member deauths"};
|
||||
|
||||
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
||||
// Central Controller Metrics
|
||||
prometheus::simpleapi::counter_metric_t pgsql_mem_notification
|
||||
{ "controller_pgsql_member_notifications_received", "number of member change notifications received via pgsql NOTIFY" };
|
||||
prometheus::simpleapi::counter_metric_t pgsql_net_notification
|
||||
{ "controller_pgsql_network_notifications_received", "number of network change notifications received via pgsql NOTIFY" };
|
||||
prometheus::simpleapi::counter_metric_t redis_mem_notification
|
||||
{ "controller_redis_member_notifications_received", "number of member change notifications received via redis" };
|
||||
prometheus::simpleapi::counter_metric_t redis_net_notification
|
||||
{ "controller_redis_network_notifications_received", "number of network change notifications received via redis" };
|
||||
|
||||
// Central DB Pool Metrics
|
||||
prometheus::simpleapi::counter_metric_t conn_counter
|
||||
{ "controller_pgsql_connections_created", "number of pgsql connections created"};
|
||||
prometheus::simpleapi::counter_metric_t max_pool_size
|
||||
{ "controller_pgsql_max_conn_pool_size", "max connection pool size for postgres"};
|
||||
prometheus::simpleapi::counter_metric_t min_pool_size
|
||||
{ "controller_pgsql_min_conn_pool_size", "minimum connection pool size for postgres" };
|
||||
prometheus::simpleapi::gauge_metric_t pool_avail
|
||||
{ "controller_pgsql_available_conns", "number of available postgres connections" };
|
||||
prometheus::simpleapi::gauge_metric_t pool_in_use
|
||||
{ "controller_pgsql_in_use_conns", "number of postgres database connections in use" };
|
||||
prometheus::simpleapi::counter_metric_t pool_errors
|
||||
{ "controller_pgsql_connection_errors", "number of connection errors the connection pool has seen" };
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -6,43 +6,27 @@
|
|||
namespace ZeroTier {
|
||||
namespace Metrics {
|
||||
// General Controller Metrics
|
||||
static prometheus::simpleapi::gauge_metric_t network_count
|
||||
{"controller_network_count", "number of networks the controller is serving"};
|
||||
static prometheus::simpleapi::gauge_metric_t member_count
|
||||
{"controller_member_count", "number of network members the controller is serving"};
|
||||
static prometheus::simpleapi::counter_metric_t network_changes
|
||||
{"controller_network_change_count", "number of times a network configuration is changed"};
|
||||
static prometheus::simpleapi::counter_metric_t member_changes
|
||||
{"controller_member_change_count", "number of times a network member configuration is changed"};
|
||||
static prometheus::simpleapi::counter_metric_t member_auths
|
||||
{"controller_member_auth_count", "number of network member auths"};
|
||||
static prometheus::simpleapi::counter_metric_t member_deauths
|
||||
{"controller_member_deauth_count", "number of network member deauths"};
|
||||
static prometheus::simpleapi::gauge_metric_t network_count;
|
||||
extern prometheus::simpleapi::gauge_metric_t member_count;
|
||||
extern prometheus::simpleapi::counter_metric_t network_changes;
|
||||
extern prometheus::simpleapi::counter_metric_t member_changes;
|
||||
extern prometheus::simpleapi::counter_metric_t member_auths;
|
||||
extern prometheus::simpleapi::counter_metric_t member_deauths;
|
||||
|
||||
#ifdef ZT_CONTROLLER_USE_LIBPQ
|
||||
// Central Controller Metrics
|
||||
static prometheus::simpleapi::counter_metric_t pgsql_mem_notification
|
||||
{ "controller_pgsql_member_notifications_received", "number of member change notifications received via pgsql NOTIFY" };
|
||||
static prometheus::simpleapi::counter_metric_t pgsql_net_notification
|
||||
{ "controller_pgsql_network_notifications_received", "number of network change notifications received via pgsql NOTIFY" };
|
||||
static prometheus::simpleapi::counter_metric_t redis_mem_notification
|
||||
{ "controller_redis_member_notifications_received", "number of member change notifications received via redis" };
|
||||
static prometheus::simpleapi::counter_metric_t redis_net_notification
|
||||
{ "controller_redis_network_notifications_received", "number of network change notifications received via redis" };
|
||||
extern prometheus::simpleapi::counter_metric_t pgsql_mem_notification;
|
||||
extern prometheus::simpleapi::counter_metric_t pgsql_net_notification;
|
||||
extern prometheus::simpleapi::counter_metric_t redis_mem_notification;
|
||||
extern prometheus::simpleapi::counter_metric_t redis_net_notification;
|
||||
|
||||
// Central DB Pool Metrics
|
||||
static prometheus::simpleapi::counter_metric_t conn_counter
|
||||
{ "controller_pgsql_connections_created", "number of pgsql connections created"};
|
||||
static prometheus::simpleapi::counter_metric_t max_pool_size
|
||||
{ "controller_pgsql_max_conn_pool_size", "max connection pool size for postgres"};
|
||||
static prometheus::simpleapi::counter_metric_t min_pool_size
|
||||
{ "controller_pgsql_min_conn_pool_size", "minimum connection pool size for postgres" };
|
||||
static prometheus::simpleapi::gauge_metric_t pool_avail
|
||||
{ "controller_pgsql_available_conns", "number of available postgres connections" };
|
||||
static prometheus::simpleapi::gauge_metric_t pool_in_use
|
||||
{ "controller_pgsql_in_use_conns", "number of postgres database connections in use" };
|
||||
static prometheus::simpleapi::counter_metric_t pool_errors
|
||||
{ "controller_pgsql_connection_errors", "number of connection errors the connection pool has seen" };
|
||||
extern prometheus::simpleapi::counter_metric_t conn_counter;
|
||||
extern prometheus::simpleapi::counter_metric_t max_pool_size;
|
||||
extern prometheus::simpleapi::counter_metric_t min_pool_size;
|
||||
extern prometheus::simpleapi::gauge_metric_t pool_avail;
|
||||
extern prometheus::simpleapi::gauge_metric_t pool_in_use;
|
||||
extern prometheus::simpleapi::counter_metric_t pool_errors;
|
||||
#endif
|
||||
} // namespace Metrics
|
||||
}// namespace ZeroTier
|
||||
|
|
|
@ -10,6 +10,7 @@ CORE_OBJS=\
|
|||
node/IncomingPacket.o \
|
||||
node/InetAddress.o \
|
||||
node/Membership.o \
|
||||
node/Metrics.o \
|
||||
node/Multicaster.o \
|
||||
node/Network.o \
|
||||
node/NetworkConfig.o \
|
||||
|
|
Loading…
Add table
Reference in a new issue