Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter api-gateway cache logging to reduce log output on server disconnect #2880

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading