From ed237708aab39b15da9cf25168c091506d13a51a Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Tue, 14 Nov 2023 00:53:46 +0000 Subject: [PATCH] Added cookie and max collision metrics (#61) * Added metrics for cookies. * Added metrics for cache max_collisons. --- unbound_exporter.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/unbound_exporter.go b/unbound_exporter.go index e699fee..c104e2e 100644 --- a/unbound_exporter.go +++ b/unbound_exporter.go @@ -80,6 +80,24 @@ var ( prometheus.CounterValue, []string{"thread"}, "^thread(\\d+)\\.num\\.cachemiss$"), + newUnboundMetric( + "queries_cookie_client_total", + "Total number of queries with a client cookie.", + prometheus.CounterValue, + []string{"thread"}, + "^thread(\\d+)\\.num\\.queries_cookie_client$"), + newUnboundMetric( + "queries_cookie_invalid_total", + "Total number of queries with a invalid cookie.", + prometheus.CounterValue, + []string{"thread"}, + "^thread(\\d+)\\.num\\.queries_invalid_client$"), + newUnboundMetric( + "queries_cookie_valid_total", + "Total number of queries with a valid cookie.", + prometheus.CounterValue, + []string{"thread"}, + "^thread(\\d+)\\.num\\.queries_cookie_valid$"), newUnboundMetric( "memory_caches_bytes", "Memory in bytes in use by caches.", @@ -236,6 +254,12 @@ var ( prometheus.CounterValue, nil, "^num\\.rrset\\.bogus$"), + newUnboundMetric( + "rrset_cache_max_collisions_total", + "Total number of rrset cache hashtable collisions.", + prometheus.CounterValue, + nil, + "^rrset\\.cache\\.max_collisions$"), newUnboundMetric( "time_elapsed_seconds", "Time since last statistics printout in seconds.", @@ -284,6 +308,12 @@ var ( prometheus.GaugeValue, nil, "^msg\\.cache\\.count$"), + newUnboundMetric( + "msg_cache_max_collisions_total", + "Total number of msg cache hashtable collisions.", + prometheus.CounterValue, + nil, + "^msg\\.cache\\.max_collisions$"), newUnboundMetric( "rrset_cache_count", "The Number of rrset cached",