From 6386a3eb9628315e23e16637ea5d29e72b053f0f Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Tue, 15 Apr 2025 13:05:19 +0200 Subject: Expose the number of keepalive pings we send --- src/metrics.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/metrics.c') diff --git a/src/metrics.c b/src/metrics.c index 7bac410..115b782 100644 --- a/src/metrics.c +++ b/src/metrics.c @@ -17,6 +17,7 @@ prom_histogram_t *offered = NULL; prom_gauge_t *activeNodes = NULL; prom_gauge_t *requestsInFlight = NULL; prom_counter_t *retries = NULL; +prom_counter_t *keepalive_count = NULL; enum MHD_Result promhttp_handler( void *cls, @@ -192,6 +193,15 @@ void metric_init() { NULL ) ); + + keepalive_count = prom_collector_registry_must_register_metric( + prom_counter_new( + "dht_keepalive_count", + "Number of times a node has been pinged due to inactivity", + 0, + NULL + ) + ); } void metric_end() { -- cgit v1.2.3