Skip to content

Commit

Permalink
Backport of Filter api-gateway cache logging to reduce log output on …
Browse files Browse the repository at this point in the history
…server disconnect into release/1.2.x (#2893)

* backport of commit 76913ec

* backport of commit 9c48dc4

---------

Co-authored-by: Curt Bushko <[email protected]>
  • Loading branch information
hc-github-team-consul-core and curtbushko authored Sep 5, 2023
1 parent 0e562d7 commit 653e7fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/2880.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
api-gateway: reduce log output when disconnecting from consul server
```
4 changes: 3 additions & 1 deletion control-plane/api-gateway/cache/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ func (c *Cache) subscribeToConsul(ctx context.Context, kind string) {
if err != nil {
// if we timeout we don't care about the error message because it's expected to happen on long polls
// any other error we want to alert on
if !strings.Contains(strings.ToLower(err.Error()), "timeout") {
if !strings.Contains(strings.ToLower(err.Error()), "timeout") &&
!strings.Contains(strings.ToLower(err.Error()), "no such host") &&
!strings.Contains(strings.ToLower(err.Error()), "connection refused") {
c.logger.Error(err, fmt.Sprintf("error fetching config entries for kind: %s", kind))
}
continue
Expand Down

0 comments on commit 653e7fd

Please sign in to comment.