From: Otto Date: Tue, 29 Jun 2021 13:00:46 +0000 (+0200) Subject: Add dns64 metrics X-Git-Tag: dnsdist-1.7.0-alpha1~65^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1bafa8c18d463dc2ac2db6b7a6bacc639e5aebe;p=thirdparty%2Fpdns.git Add dns64 metrics --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index f1204784dd..44020ec4dd 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1520,6 +1520,7 @@ int getFakeAAAARecords(const DNSName& qname, ComboAddress prefix, vector& ret) int rcode = directResolve(DNSName(newquery), QType::PTR, QClass::IN, ret); + g_stats.dns64prefixanswers++; return rcode; } diff --git a/pdns/rec-snmp.cc b/pdns/rec-snmp.cc index cc6b5541aa..745b48f145 100644 --- a/pdns/rec-snmp.cc +++ b/pdns/rec-snmp.cc @@ -131,6 +131,7 @@ static const oid aggressiveNSECCacheNSEC3HitsOID[] = { RECURSOR_STATS_OID, 110 } static const oid aggressiveNSECCacheNSECWCHitsOID[] = { RECURSOR_STATS_OID, 111 }; static const oid aggressiveNSECCacheNSEC3WCHitsOID[] = { RECURSOR_STATS_OID, 112 }; static const oid dotOutqueriesOID [] = { RECURSOR_STATS_OID, 113 }; +static const oid dns64PrefixAnswers [] = { RECURSOR_STATS_OID, 114 }; static std::unordered_map s_statsMap; @@ -353,5 +354,6 @@ RecursorSNMPAgent::RecursorSNMPAgent(const std::string& name, const std::string& registerCounter64Stat("aggressive-nsec-cache-nsec-wc-hits", aggressiveNSECCacheNSECWCHitsOID, OID_LENGTH(aggressiveNSECCacheNSECWCHitsOID)); registerCounter64Stat("aggressive-nsec-cache-nsec-wc3-hits", aggressiveNSECCacheNSEC3WCHitsOID, OID_LENGTH(aggressiveNSECCacheNSEC3WCHitsOID)); registerCounter64Stat("dot-outqueries", dotOutqueriesOID, OID_LENGTH(dotOutqueriesOID)); + registerCounter64Stat("dns64-prefix-answers", dns64PrefixAnswers, OID_LENGTH(dns64PrefixAnswers)); #endif /* HAVE_NET_SNMP */ } diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index e1eb007f58..9234b412ae 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -1364,6 +1364,8 @@ static void registerAllStats1() addGetStat("taskqueue-expired", []() { return getTaskExpired(); }); addGetStat("taskqueue-size", []() { return getTaskSize(); }); + addGetStat("dns64-prefix-answers", &g_stats.dns64prefixanswers); + /* make sure that the ECS stats are properly initialized */ SyncRes::clearECSStats(); for (size_t idx = 0; idx < SyncRes::s_ecsResponsesBySubnetSize4.size(); idx++) { diff --git a/pdns/recursordist/RECURSOR-MIB.txt b/pdns/recursordist/RECURSOR-MIB.txt index cc7ad62b84..749e193112 100644 --- a/pdns/recursordist/RECURSOR-MIB.txt +++ b/pdns/recursordist/RECURSOR-MIB.txt @@ -946,6 +946,14 @@ dotOutqueries OBJECT-TYPE "Number of outgoing DoT queries since starting" ::= { stats 113 } +dns64PrefixAnswers OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Number of answers generated by dns64-prefix matching" + ::= { stats 114 } + --- --- Traps / Notifications --- @@ -1102,7 +1110,8 @@ recGroup OBJECT-GROUP aggressiveNSECCacheNSEC3Hits, aggressiveNSECCacheNSECWcHits, aggressiveNSECCacheNSEC3WcHits, - dotOutqueries + dotOutqueries, + dns64PrefixAnswers } STATUS current DESCRIPTION "Objects conformance group for PowerDNS Recursor" diff --git a/pdns/recursordist/docs/metrics.rst b/pdns/recursordist/docs/metrics.rst index aec71dc44e..d1c2c27a10 100644 --- a/pdns/recursordist/docs/metrics.rst +++ b/pdns/recursordist/docs/metrics.rst @@ -268,6 +268,8 @@ Stolen time, which is the time spent by the whole system in other operating syst cumul-answers-x ^^^^^^^^^^^^^^^^^^ +.. versionadded:: 4.6 + Cumulative counts of answer times in buckets less or equal than x microseconds. These metrics include packet cache hits. These metrics are useful for Prometheus and not listed other outputs by default. @@ -275,14 +277,23 @@ These metrics are useful for Prometheus and not listed other outputs by default. cumul-auth4-answers-x ^^^^^^^^^^^^^^^^^^^^^ +.. versionadded:: 4.6 + Cumulative counts of answer times of authoritative servers over IPv4 in buckets less than x microseconds. These metrics are useful for Prometheus and not listed other outputs by default. cumul-auth6-answers-x ^^^^^^^^^^^^^^^^^^^^^ +.. versionadded:: 4.6 + Cumulative counts of answer times of authoritative servers over IPv6 in buckets less than x microseconds. These metrics are useful for Prometheus and not listed other outputs by default. +dns64-prefix-answers +^^^^^^^^^^^^^^^^^^^^ +.. versionadded:: 4.6 + +number of ``AAAA`` and ``PTR`` answers generated by :ref:`setting-dns64-prefix` matching. dnssec-authentic-data-queries ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pdns/recursordist/docs/settings.rst b/pdns/recursordist/docs/settings.rst index 75d73b83e8..10a7b37747 100644 --- a/pdns/recursordist/docs/settings.rst +++ b/pdns/recursordist/docs/settings.rst @@ -389,7 +389,7 @@ ratio. .. _settings-dot-to-auth-names: ``dot-to-auth-names`` -------------------- +--------------------- .. versionadded:: 4.6.0 - Comma separated list of domain-names or suffixes @@ -418,8 +418,8 @@ Enable DoT to forwarders that specify port 853. - Netmask, as a string - Default: None -Enable DNS64 (:rfc:`6147`) support using the supplied /96 IPv6 prefix. This will generate 'fake' AAAA records for names -with only `A` records, as well as 'fake' PTR records to make sure that reverse lookup of DNS64-generated IPv6 addresses +Enable DNS64 (:rfc:`6147`) support using the supplied /96 IPv6 prefix. This will generate 'fake' ``AAAA`` records for names +with only ``A`` records, as well as 'fake' ``PTR`` records to make sure that reverse lookup of DNS64-generated IPv6 addresses generate the right name. See :doc:`dns64` for more flexible but slower alternatives using Lua. diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 9396c315a1..4b91cfe814 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -1052,6 +1052,7 @@ struct RecursorStats std::atomic rebalancedQueries{0}; std::atomic proxyProtocolInvalidCount{0}; std::atomic nodLookupsDroppedOversize{0}; + std::atomic dns64prefixanswers{0}; RecursorStats() : answers("answers", { 1000, 10000, 100000, 1000000 }), diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index 56f9722dc5..c73aca44ce 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -1034,6 +1034,10 @@ const std::map MetricDefinitionStorage::metrics = MetricDefinition(PrometheusMetricType::counter, "Number of outgoing DoT queries since starting")}, + { "dns64-prefix-answers", + MetricDefinition(PrometheusMetricType::counter, + "Number of AAAA and PTR generated by a matching dns64-prefix")}, + // For cumulative histogram, state the xxx_count name where xxx matches the name in rec_channel_rec { "cumul-answers-count", MetricDefinition(PrometheusMetricType::histogram,