diff --git a/.changelog/2880.txt b/.changelog/2880.txt new file mode 100644 index 0000000000..b06fcf985f --- /dev/null +++ b/.changelog/2880.txt @@ -0,0 +1,3 @@ +```release-note:improvement +api-gateway: reduce log output when disconnecting from consul server +``` diff --git a/control-plane/api-gateway/cache/consul.go b/control-plane/api-gateway/cache/consul.go index 7737e80d57..f34538103d 100644 --- a/control-plane/api-gateway/cache/consul.go +++ b/control-plane/api-gateway/cache/consul.go @@ -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