]> git.ipfire.org Git - collecty.git/commitdiff
unbound: Read answer return codes
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Nov 2025 14:29:02 +0000 (14:29 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Nov 2025 14:29:02 +0000 (14:29 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/sources/unbound.c

index 4d418d82191d8e48249dd1acd609a577da9acf7a..88e094c07f22e7138edcf458c98ef394a4a9af75 100644 (file)
@@ -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 },
        },