ipv4 and ipv6 for the new Prometheus-friendly histograms.
aton
attr
atype
+authanswers
AUTHIP
Authoritativedoc
auths
chrooting
CIDR
classmethod
+clientanswers
Cloos
closesocket
clusions
for (size_t idx = 0; idx < 128; idx++) {
defaultAPIDisabledStats += ", ecs-v6-response-bits-" + std::to_string(idx + 1);
}
- std::string defaultDisabledStats = defaultAPIDisabledStats + ", cumul-answers, cumul-auth4answers, cumul-auth6answers, policy-hits";
+ std::string defaultDisabledStats = defaultAPIDisabledStats + ", cumul-clientanswers, cumul-authanswers, policy-hits";
::arg().set("stats-api-blacklist", "List of statistics that are disabled when retrieving the complete list of statistics via the API (deprecated)")=defaultAPIDisabledStats;
::arg().set("stats-carbon-blacklist", "List of statistics that are prevented from being exported via Carbon (deprecated)")=defaultDisabledStats;
snprintf(buf, sizeof(buf), "%g", bucket.d_boundary / 1e6);
std::string pname = pbasename + "seconds_bucket{" + "le=\"" +
(bucket.d_boundary == std::numeric_limits<uint64_t>::max() ? "+Inf" : buf) + "\"}";
- entries.emplace(make_pair(bucket.d_name, StatsMapEntry{pname, std::to_string(bucket.d_count)}));
+ entries.emplace(bucket.d_name, StatsMapEntry{pname, std::to_string(bucket.d_count)});
}
snprintf(buf, sizeof(buf), "%g", histogram.getSum() / 1e6);
- entries.emplace(make_pair(name + "sum", StatsMapEntry{pbasename + "seconds_sum", buf}));
- entries.emplace(make_pair(name + "count", StatsMapEntry{pbasename + "seconds_count", std::to_string(data.back().d_count)}));
+ entries.emplace(name + "sum", StatsMapEntry{pbasename + "seconds_sum", buf});
+ entries.emplace(name + "count", StatsMapEntry{pbasename + "seconds_count", std::to_string(data.back().d_count)});
+
+ return entries;
+}
+
+static StatsMap toStatsMap(const string& name, const pdns::AtomicHistogram& histogram4, const pdns::AtomicHistogram& histogram6)
+{
+ const string pbasename = getPrometheusName(name);
+ StatsMap entries;
+ char buf[32];
+ std::string pname;
+
+ const auto& data4 = histogram4.getCumulativeBuckets();
+ for (const auto& bucket : data4) {
+ snprintf(buf, sizeof(buf), "%g", bucket.d_boundary / 1e6);
+ pname = pbasename + "seconds_bucket{ipversion=\"v4\",le=\"" +
+ (bucket.d_boundary == std::numeric_limits<uint64_t>::max() ? "+Inf" : buf) + "\"}";
+ entries.emplace(bucket.d_name + "-4", StatsMapEntry{pname, std::to_string(bucket.d_count)});
+ }
+
+ const auto& data6 = histogram6.getCumulativeBuckets();
+ for (const auto& bucket : data6) {
+ snprintf(buf, sizeof(buf), "%g", bucket.d_boundary / 1e6);
+ pname = pbasename + "seconds_bucket{ipversion=\"v6\",le=\"" +
+ (bucket.d_boundary == std::numeric_limits<uint64_t>::max() ? "+Inf" : buf) + "\"}";
+ entries.emplace(bucket.d_name + "-6", StatsMapEntry{pname, std::to_string(bucket.d_count)});
+ }
+
+ snprintf(buf, sizeof(buf), "%g", (histogram4.getSum() + histogram6.getSum()) / 1e6);
+ entries.emplace(name + "sum", StatsMapEntry{pbasename + "seconds_sum", buf});
+ entries.emplace(name + "count", StatsMapEntry{pbasename + "seconds_count", std::to_string(data4.back().d_count + data6.back().d_count)});
return entries;
}
addGetStat(name, &(SyncRes::s_ecsResponsesBySubnetSize6.at(idx)));
}
- addGetStat("cumul-answers", []() {
+ addGetStat("cumul-clientanswers", []() {
return toStatsMap(g_stats.cumulativeAnswers.getName(), g_stats.cumulativeAnswers);
});
- addGetStat("cumul-auth4answers", []() {
- return toStatsMap(g_stats.cumulativeAuth4Answers.getName(), g_stats.cumulativeAuth4Answers);
- });
- addGetStat("cumul-auth6answers", []() {
- return toStatsMap(g_stats.cumulativeAuth6Answers.getName(), g_stats.cumulativeAuth6Answers);
+ addGetStat("cumul-authanswers", []() {
+ return toStatsMap(g_stats.cumulativeAuth4Answers.getName(), g_stats.cumulativeAuth4Answers, g_stats.cumulativeAuth6Answers);
});
addGetStat("policy-hits", []() {
return toRPZStatsMap("policy-hits", g_stats.policyHits);
Stolen time, which is the time spent by the whole system in other operating systems when running in a virtualized environment, in units of USER_HZ.
-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.
-
-cumul-auth4-answers-x
+cumul-authanswers-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.
+Cumulative counts of answer times of authoritative servers in buckets less than x microseconds.
+These metrics are useful for Prometheus and not listed in other outputs by default.
-cumul-auth6-answers-x
-^^^^^^^^^^^^^^^^^^^^^
+cumul-clientanswers-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.
+Cumulative counts of our answer times to clients in buckets less or equal than x microseconds.
+These metrics include packet cache hits.
+These metrics are useful for Prometheus and not listed in other outputs by default.
dns64-prefix-answers
^^^^^^^^^^^^^^^^^^^^
auth4Answers("auth4answers", { 1000, 10000, 100000, 1000000 }),
auth6Answers("auth6answers", { 1000, 10000, 100000, 1000000 }),
ourtime("ourtime", { 1000, 2000, 4000, 8000, 16000, 32000 }),
- cumulativeAnswers("cumul-answers-", 10, 19),
- cumulativeAuth4Answers("cumul-auth4answers-", 1000, 13),
- cumulativeAuth6Answers("cumul-auth6answers-", 1000, 13)
+ cumulativeAnswers("cumul-clientanswers-", 10, 19),
+ // These two will be merged when outputting
+ cumulativeAuth4Answers("cumul-authanswers-", 1000, 13),
+ cumulativeAuth6Answers("cumul-authanswers-", 1000, 13)
{
}
};
"Number of answers synthesized from the NSEC3 aggressive cache")},
// For cumulative histogram, state the xxx_count name where xxx matches the name in rec_channel_rec
- { "cumul-answers-count",
+ { "cumul-clientanswers-count",
MetricDefinition(PrometheusMetricType::histogram,
- "histogram of our answer times")},
+ "histogram of our answer times to clients")},
// For cumulative histogram, state the xxx_count name where xxx matches the name in rec_channel_rec
- { "cumul-auth4answers-count",
+ { "cumul-authanswers-count",
MetricDefinition(PrometheusMetricType::histogram,
- "histogram of authoritative answer times over IPv4")},
- // For cumulative histogram, state the xxx_count name where xxx matches the name in rec_channel_rec
- { "cumul-auth6answers-count",
- MetricDefinition(PrometheusMetricType::histogram,
- "histogram of authoritative answer times over IPV6")},
-
+ "histogram of answer times of authoritative servers")},
{ "almost-expired-pushed",
MetricDefinition(PrometheusMetricType::counter,
"number of almost-expired tasks pushed")},