From: Mischan Toosarani-Hausberger Date: Thu, 4 Jun 2020 17:26:05 +0000 (+0200) Subject: auth: Declare ring-capacity metrics as gauges. X-Git-Tag: dnsdist-1.5.0-rc3~22^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32a64e3743896b8e48e6d65779fee4bcf159ecc8;p=thirdparty%2Fpdns.git auth: Declare ring-capacity metrics as gauges. --- diff --git a/docs/http-api/index.rst b/docs/http-api/index.rst index 81ee64ea17..b55be7f110 100644 --- a/docs/http-api/index.rst +++ b/docs/http-api/index.rst @@ -199,34 +199,34 @@ A simple ``GET`` request will return a response similar to the following: # TYPE pdns_auth_real_memory_usage gauge pdns_auth_real_memory_usage 133189632 # HELP pdns_auth_ring_logmessages_capacity Maximum number of entries in the logmessages ring - # TYPE pdns_auth_ring_logmessages_capacity counter + # TYPE pdns_auth_ring_logmessages_capacity gauge pdns_auth_ring_logmessages_capacity 10000 # HELP pdns_auth_ring_logmessages_size Number of entries in the logmessages ring # TYPE pdns_auth_ring_logmessages_size counter pdns_auth_ring_logmessages_size 7 # HELP pdns_auth_ring_noerror_queries_capacity Maximum number of entries in the noerror-queries ring - # TYPE pdns_auth_ring_noerror_queries_capacity counter + # TYPE pdns_auth_ring_noerror_queries_capacity gauge pdns_auth_ring_noerror_queries_capacity 10000 # HELP pdns_auth_ring_noerror_queries_size Number of entries in the noerror-queries ring # TYPE pdns_auth_ring_noerror_queries_size counter pdns_auth_ring_noerror_queries_size 0 # HELP pdns_auth_ring_nxdomain_queries_capacity Maximum number of entries in the nxdomain-queries ring - # TYPE pdns_auth_ring_nxdomain_queries_capacity counter + # TYPE pdns_auth_ring_nxdomain_queries_capacity gauge pdns_auth_ring_nxdomain_queries_capacity 10000 # HELP pdns_auth_ring_nxdomain_queries_size Number of entries in the nxdomain-queries ring # TYPE pdns_auth_ring_nxdomain_queries_size counter pdns_auth_ring_nxdomain_queries_size 0 # HELP pdns_auth_ring_queries_capacity Maximum number of entries in the queries ring - # TYPE pdns_auth_ring_queries_capacity counter + # TYPE pdns_auth_ring_queries_capacity gauge pdns_auth_ring_queries_capacity 10000 # HELP pdns_auth_ring_queries_size Number of entries in the queries ring # TYPE pdns_auth_ring_queries_size counter pdns_auth_ring_queries_size 0 # HELP pdns_auth_ring_remotes_capacity Maximum number of entries in the remotes ring - # TYPE pdns_auth_ring_remotes_capacity counter + # TYPE pdns_auth_ring_remotes_capacity gauge pdns_auth_ring_remotes_capacity 10000 # HELP pdns_auth_ring_remotes_corrupt_capacity Maximum number of entries in the remotes-corrupt ring - # TYPE pdns_auth_ring_remotes_corrupt_capacity counter + # TYPE pdns_auth_ring_remotes_corrupt_capacity gauge pdns_auth_ring_remotes_corrupt_capacity 10000 # HELP pdns_auth_ring_remotes_corrupt_size Number of entries in the remotes-corrupt ring # TYPE pdns_auth_ring_remotes_corrupt_size counter @@ -235,19 +235,19 @@ A simple ``GET`` request will return a response similar to the following: # TYPE pdns_auth_ring_remotes_size counter pdns_auth_ring_remotes_size 0 # HELP pdns_auth_ring_remotes_unauth_capacity Maximum number of entries in the remotes-unauth ring - # TYPE pdns_auth_ring_remotes_unauth_capacity counter + # TYPE pdns_auth_ring_remotes_unauth_capacity gauge pdns_auth_ring_remotes_unauth_capacity 10000 # HELP pdns_auth_ring_remotes_unauth_size Number of entries in the remotes-unauth ring # TYPE pdns_auth_ring_remotes_unauth_size counter pdns_auth_ring_remotes_unauth_size 0 # HELP pdns_auth_ring_servfail_queries_capacity Maximum number of entries in the servfail-queries ring - # TYPE pdns_auth_ring_servfail_queries_capacity counter + # TYPE pdns_auth_ring_servfail_queries_capacity gauge pdns_auth_ring_servfail_queries_capacity 10000 # HELP pdns_auth_ring_servfail_queries_size Number of entries in the servfail-queries ring # TYPE pdns_auth_ring_servfail_queries_size counter pdns_auth_ring_servfail_queries_size 0 # HELP pdns_auth_ring_unauth_queries_capacity Maximum number of entries in the unauth-queries ring - # TYPE pdns_auth_ring_unauth_queries_capacity counter + # TYPE pdns_auth_ring_unauth_queries_capacity gauge pdns_auth_ring_unauth_queries_capacity 10000 # HELP pdns_auth_ring_unauth_queries_size Number of entries in the unauth-queries ring # TYPE pdns_auth_ring_unauth_queries_size counter diff --git a/pdns/statbag.cc b/pdns/statbag.cc index 70eddcb244..9f2814aeab 100644 --- a/pdns/statbag.cc +++ b/pdns/statbag.cc @@ -245,7 +245,7 @@ vector >StatRing::get() const void StatBag::registerRingStats(const string& name) { declare("ring-" + name + "-size", "Number of entries in the " + name + " ring", [this,name](const std::string&) { return static_cast(getRingEntriesCount(name)); }, StatType::counter); - declare("ring-" + name + "-capacity", "Maximum number of entries in the " + name + " ring", [this,name](const std::string&) { return static_cast(getRingSize(name)); }, StatType::counter); + declare("ring-" + name + "-capacity", "Maximum number of entries in the " + name + " ring", [this,name](const std::string&) { return static_cast(getRingSize(name)); }, StatType::gauge); } void StatBag::declareRing(const string &name, const string &help, unsigned int size)