diff --git a/.changelog/21381.txt b/.changelog/21381.txt new file mode 100644 index 0000000000..e69989f032 --- /dev/null +++ b/.changelog/21381.txt @@ -0,0 +1,4 @@ +```release-note:bug +dns: Fixes a spam log message "Failed to parse TTL for prepared query..." +that was always being logged on each prepared query evaluation. +``` \ No newline at end of file diff --git a/agent/discovery/query_fetcher_v1.go b/agent/discovery/query_fetcher_v1.go index da76d744dd..31f74c0119 100644 --- a/agent/discovery/query_fetcher_v1.go +++ b/agent/discovery/query_fetcher_v1.go @@ -363,11 +363,12 @@ func (f *V1DataFetcher) FetchPreparedQuery(ctx Context, req *QueryPayload) ([]*R if err == nil { ttlSec := uint32(ttl / time.Second) ttlOverride = &ttlSec + } else { + f.logger.Warn("Failed to parse TTL for prepared query , ignoring", + "ttl", out.DNS.TTL, + "prepared_query", req.Name, + ) } - f.logger.Warn("Failed to parse TTL for prepared query , ignoring", - "ttl", out.DNS.TTL, - "prepared_query", req.Name, - ) } // If we have no nodes, return not found!