]> git.ipfire.org Git - people/ms/telemetry.git/commitdiff
unbound: Store the historgram
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Nov 2025 14:48:07 +0000 (14:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Nov 2025 14:48:07 +0000 (14:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/sources/unbound.c

index 88e094c07f22e7138edcf458c98ef394a4a9af75..37b4e3ace271a49d5aa8d50f05c03e0803d2120e 100644 (file)
@@ -66,6 +66,48 @@ static int unbound_on_success(td_ctx* ctx,
                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"),
+
+               // Histogram
+               METRIC_UINT64("histogram_1usec", "histogram.000000.000000.to.000000.000001=%ld"),
+               METRIC_UINT64("histogram_2usec", "histogram.000000.000001.to.000000.000002=%ld"),
+               METRIC_UINT64("histogram_4usec", "histogram.000000.000002.to.000000.000004=%ld"),
+               METRIC_UINT64("histogram_8usec", "histogram.000000.000004.to.000000.000008=%ld"),
+               METRIC_UINT64("histogram_16usec", "histogram.000000.000008.to.000000.000016=%ld"),
+               METRIC_UINT64("histogram_32usec", "histogram.000000.000016.to.000000.000032=%ld"),
+               METRIC_UINT64("histogram_64usec", "histogram.000000.000032.to.000000.000064=%ld"),
+               METRIC_UINT64("histogram_128usec", "histogram.000000.000064.to.000000.000128=%ld"),
+               METRIC_UINT64("histogram_256usec", "histogram.000000.000128.to.000000.000256=%ld"),
+               METRIC_UINT64("histogram_512usec", "histogram.000000.000256.to.000000.000512=%ld"),
+               METRIC_UINT64("histogram_1024usec", "histogram.000000.000512.to.000000.001024=%ld"),
+               METRIC_UINT64("histogram_2048usec", "histogram.000000.001024.to.000000.002048=%ld"),
+               METRIC_UINT64("histogram_4096usec", "histogram.000000.002048.to.000000.004096=%ld"),
+               METRIC_UINT64("histogram_8192usec", "histogram.000000.004096.to.000000.008192=%ld"),
+               METRIC_UINT64("histogram_16384usec", "histogram.000000.008192.to.000000.016384=%ld"),
+               METRIC_UINT64("histogram_32768usec", "histogram.000000.016384.to.000000.032768=%ld"),
+               METRIC_UINT64("histogram_65536usec", "histogram.000000.032768.to.000000.065536=%ld"),
+               METRIC_UINT64("histogram_131072usec", "histogram.000000.065536.to.000000.131072=%ld"),
+               METRIC_UINT64("histogram_262144usec", "histogram.000000.131072.to.000000.262144=%ld"),
+               METRIC_UINT64("histogram_524288usec", "histogram.000000.262144.to.000000.524288=%ld"),
+               METRIC_UINT64("histogram_1sec", "histogram.000000.524288.to.000001.000000=%ld"),
+               METRIC_UINT64("histogram_2sec", "histogram.000001.000000.to.000002.000000=%ld"),
+               METRIC_UINT64("histogram_4sec", "histogram.000002.000000.to.000004.000000=%ld"),
+               METRIC_UINT64("histogram_8sec", "histogram.000004.000000.to.000008.000000=%ld"),
+               METRIC_UINT64("histogram_16sec", "histogram.000008.000000.to.000016.000000=%ld"),
+               METRIC_UINT64("histogram_32sec", "histogram.000016.000000.to.000032.000000=%ld"),
+               METRIC_UINT64("histogram_64sec", "histogram.000032.000000.to.000064.000000=%ld"),
+               METRIC_UINT64("histogram_128sec", "histogram.000064.000000.to.000128.000000=%ld"),
+               METRIC_UINT64("histogram_256sec", "histogram.000128.000000.to.000256.000000=%ld"),
+               METRIC_UINT64("histogram_512sec", "histogram.000256.000000.to.000512.000000=%ld"),
+               METRIC_UINT64("histogram_1024sec", "histogram.000512.000000.to.001024.000000=%ld"),
+               METRIC_UINT64("histogram_2048sec", "histogram.001024.000000.to.002048.000000=%ld"),
+               METRIC_UINT64("histogram_4096sec", "histogram.002048.000000.to.004096.000000=%ld"),
+               METRIC_UINT64("histogram_8192sec", "histogram.004096.000000.to.008192.000000=%ld"),
+               METRIC_UINT64("histogram_16384sec", "histogram.008192.000000.to.016384.000000=%ld"),
+               METRIC_UINT64("histogram_32768sec", "histogram.016384.000000.to.032768.000000=%ld"),
+               METRIC_UINT64("histogram_65536sec", "histogram.032768.000000.to.065536.000000=%ld"),
+               METRIC_UINT64("histogram_131072sec", "histogram.065536.000000.to.131072.000000=%ld"),
+               METRIC_UINT64("histogram_262144sec", "histogram.131072.000000.to.262144.000000=%ld"),
+               METRIC_UINT64("histogram_524288sec", "histogram.262144.000000.to.524288.000000=%ld"),
        ));
 }
 
@@ -117,6 +159,48 @@ const td_source_impl unbound_source = {
                { "answer_rcode_REFUSED",  "DERIVE", 0, -1 },
                { "answer_rcode_nodata",   "DERIVE", 0, -1 },
 
+               // Histogram
+               { "histogram_1usec", "DERIVE", 0, -1 },
+               { "histogram_2usec", "DERIVE", 0, -1 },
+               { "histogram_4usec", "DERIVE", 0, -1 },
+               { "histogram_8usec", "DERIVE", 0, -1 },
+               { "histogram_16usec", "DERIVE", 0, -1 },
+               { "histogram_32usec", "DERIVE", 0, -1 },
+               { "histogram_64usec", "DERIVE", 0, -1 },
+               { "histogram_128usec", "DERIVE", 0, -1 },
+               { "histogram_256usec", "DERIVE", 0, -1 },
+               { "histogram_512usec", "DERIVE", 0, -1 },
+               { "histogram_1024usec", "DERIVE", 0, -1 },
+               { "histogram_2048usec", "DERIVE", 0, -1 },
+               { "histogram_4096usec", "DERIVE", 0, -1 },
+               { "histogram_8192usec", "DERIVE", 0, -1 },
+               { "histogram_16384usec", "DERIVE", 0, -1 },
+               { "histogram_32768usec", "DERIVE", 0, -1 },
+               { "histogram_65536usec", "DERIVE", 0, -1 },
+               { "histogram_131072usec", "DERIVE", 0, -1 },
+               { "histogram_262144usec", "DERIVE", 0, -1 },
+               { "histogram_524288usec", "DERIVE", 0, -1 },
+               { "histogram_1sec", "DERIVE", 0, -1 },
+               { "histogram_2sec", "DERIVE", 0, -1 },
+               { "histogram_4sec", "DERIVE", 0, -1 },
+               { "histogram_8sec", "DERIVE", 0, -1 },
+               { "histogram_16sec", "DERIVE", 0, -1 },
+               { "histogram_32sec", "DERIVE", 0, -1 },
+               { "histogram_64sec", "DERIVE", 0, -1 },
+               { "histogram_128sec", "DERIVE", 0, -1 },
+               { "histogram_256sec", "DERIVE", 0, -1 },
+               { "histogram_512sec", "DERIVE", 0, -1 },
+               { "histogram_1024sec", "DERIVE", 0, -1 },
+               { "histogram_2048sec", "DERIVE", 0, -1 },
+               { "histogram_4096sec", "DERIVE", 0, -1 },
+               { "histogram_8192sec", "DERIVE", 0, -1 },
+               { "histogram_16384sec", "DERIVE", 0, -1 },
+               { "histogram_32768sec", "DERIVE", 0, -1 },
+               { "histogram_65536sec", "DERIVE", 0, -1 },
+               { "histogram_131072sec", "DERIVE", 0, -1 },
+               { "histogram_262144sec", "DERIVE", 0, -1 },
+               { "histogram_524288sec", "DERIVE", 0, -1 },
+
                { NULL },
        },