From adef35049f6185aba68fe4b694c855b0af8191e3 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Tue, 10 Sep 2024 05:33:32 +0100 Subject: [PATCH] Add warning when pihole doesn't return expected data points --- internal/feed/pihole.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/feed/pihole.go b/internal/feed/pihole.go index badfb1a..3849267 100644 --- a/internal/feed/pihole.go +++ b/internal/feed/pihole.go @@ -2,6 +2,7 @@ package feed import ( "errors" + "log/slog" "net/http" "sort" "strings" @@ -63,6 +64,11 @@ func FetchPiholeStats(instanceURL, token string) (*DNSStats, error) { // Pihole _should_ return data for the last 24 hours in a 10 minute interval, 6*24 = 144 if len(responseJson.QueriesSeries) != 144 || len(responseJson.BlockedSeries) != 144 { + slog.Warn( + "DNS stats for pihole: did not get expected 144 data points", + "len(queries)", len(responseJson.QueriesSeries), + "len(blocked)", len(responseJson.BlockedSeries), + ) return stats, nil }