Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ixfrdist: add NOTIFY receive support #13322

Merged
merged 7 commits into from Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions pdns/ixfrdist-stats.cc
Expand Up @@ -85,6 +85,19 @@ std::string ixfrdistStats::getStats() {
stats<<prefix<<"ixfr_failures_total{domain=\""<<d.first<<"\"} "<<d.second.numIXFRFailures<<std::endl;
}

if (!notimpStats.empty()) {
stats<<"# HELP "<<prefix<<"notimp An unimplemented opcode"<<std::endl;
stats<<"# TYPE "<<prefix<<"notimp counter"<<std::endl;
}

for (std::size_t i = 0; i < notimpStats.size() ; i++) {
auto val = notimpStats.at(i).load();

if (val > 0) {
stats<<prefix<<"notimp{opcode=\""<<Opcode::to_s(i)<<"\"} "<<val<<std::endl;
}
}

stats<<"# HELP "<<prefix<<"unknown_domain_inqueries_total Number of queries received for domains unknown to us"<<std::endl;
stats<<"# TYPE "<<prefix<<"unknown_domain_inqueries_total counter"<<std::endl;
stats<<prefix<<"unknown_domain_inqueries_total "<<progStats.unknownDomainInQueries<<std::endl;
Expand Down
7 changes: 7 additions & 0 deletions pdns/ixfrdist-stats.hh
Expand Up @@ -24,6 +24,7 @@
#include <map>
#include <string>

#include "dns.hh"
#include "dnsname.hh"
#include "pdnsexception.hh"

Expand Down Expand Up @@ -70,6 +71,11 @@ class ixfrdistStats {
progStats.unknownDomainInQueries += 1;
}

void incrementNotImplemented(uint8_t opcode)
{
notimpStats.at(opcode) ++;
}

private:
class perDomainStat {
public:
Expand All @@ -93,6 +99,7 @@ class ixfrdistStats {
};

std::map<DNSName, perDomainStat> domainStats;
std::array<std::atomic<uint64_t>, 16> notimpStats;
programStats progStats;

std::map<DNSName, perDomainStat>::iterator getRegisteredDomain(const DNSName& d) {
Expand Down