Skip to content

Commit e1dc9ed

Browse files
Backport of fix(dns): spam ttl logs for prepared queries into release/1.19.x (#21522)
backport of commit 1c7c5be Co-authored-by: DanStough <dan.stough@hashicorp.com>
1 parent ad6931c commit e1dc9ed

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changelog/21381.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
```release-note:bug
2+
dns: Fixes a spam log message "Failed to parse TTL for prepared query..."
3+
that was always being logged on each prepared query evaluation.
4+
```

agent/discovery/query_fetcher_v1.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,12 @@ func (f *V1DataFetcher) FetchPreparedQuery(ctx Context, req *QueryPayload) ([]*R
363363
if err == nil {
364364
ttlSec := uint32(ttl / time.Second)
365365
ttlOverride = &ttlSec
366+
} else {
367+
f.logger.Warn("Failed to parse TTL for prepared query , ignoring",
368+
"ttl", out.DNS.TTL,
369+
"prepared_query", req.Name,
370+
)
366371
}
367-
f.logger.Warn("Failed to parse TTL for prepared query , ignoring",
368-
"ttl", out.DNS.TTL,
369-
"prepared_query", req.Name,
370-
)
371372
}
372373

373374
// If we have no nodes, return not found!

0 commit comments

Comments
 (0)