From: Michael Tremer Date: Fri, 28 Nov 2025 14:29:02 +0000 (+0000) Subject: unbound: Read answer return codes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfb357ebee529d3bb6d056e11528cf07eda824ae;p=collecty.git unbound: Read answer return codes Signed-off-by: Michael Tremer --- diff --git a/src/daemon/sources/unbound.c b/src/daemon/sources/unbound.c index 4d418d8..88e094c 100644 --- a/src/daemon/sources/unbound.c +++ b/src/daemon/sources/unbound.c @@ -57,6 +57,15 @@ static int unbound_on_success(td_ctx* ctx, METRIC_UINT64("mem_mod_iterator", "mem.mod.iterator=%ld"), METRIC_UINT64("mem_mod_validator", "mem.mod.validator=%ld"), METRIC_UINT64("mem_mod_respip", "mem.mod.respip=%ld"), + + // Answers + METRIC_UINT64("answer_rcode_NOERROR", "num.answer.rcode.NOERROR=%ld"), + METRIC_UINT64("answer_rcode_FORMERR", "num.answer.rcode.FORMERR=%ld"), + METRIC_UINT64("answer_rcode_SERVFAIL", "num.answer.rcode.SERVFAIL=%ld"), + METRIC_UINT64("answer_rcode_NXDOMAIN", "num.answer.rcode.NXDOMAIN=%ld"), + METRIC_UINT64("answer_rcode_NOTIMPL", "num.answer.rcode.NOTIMPL=%ld"), + METRIC_UINT64("answer_rcode_REFUSED", "num.answer.rcode.REFUSED=%ld"), + METRIC_UINT64("answer_rcode_nodata", "num.answer.rcode.nodata=%ld"), )); } @@ -99,6 +108,15 @@ const td_source_impl unbound_source = { { "mem_mod_validator", "GAUGE", 0, -1 }, { "mem_mod_respip", "GAUGE", 0, -1 }, + // Answers + { "answer_rcode_NOERROR", "DERIVE", 0, -1 }, + { "answer_rcode_FORMERR", "DERIVE", 0, -1 }, + { "answer_rcode_SERVFAIL", "DERIVE", 0, -1 }, + { "answer_rcode_NXDOMAIN", "DERIVE", 0, -1 }, + { "answer_rcode_NOTIMPL", "DERIVE", 0, -1 }, + { "answer_rcode_REFUSED", "DERIVE", 0, -1 }, + { "answer_rcode_nodata", "DERIVE", 0, -1 }, + { NULL }, },