Skip to content

Commit

Permalink
routesrv: do not log empty routes as error (#2914)
Browse files Browse the repository at this point in the history
`routesrv` may be configured to produce no routes,
e.g. to only serve Redis endpoints from the namespace without
Ingresses/RouteGroups:
```sh
bin/routesrv \
-enable-kubernetes-endpointslices \
-kubernetes-namespace=my-redis-ns \
-kubernetes-redis-service-namespace=my-redis-ns \
-kubernetes-redis-service-name=my-redis \
-kubernetes-https-redirect=false \
-kubernetes-healthcheck=false \
...
```

For #2476

Signed-off-by: Alexander Yastrebov <[email protected]>
  • Loading branch information
AlexanderYastrebov authored Feb 8, 2024
1 parent 39a1bcf commit 1045666
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions routesrv/polling.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,9 @@ func (p *poller) poll(wg *sync.WaitGroup) {
"message", fmt.Sprintf("%s: %s", LogRoutesFetchingFailed, err),
)
case routesCount == 0:
log.Error(LogRoutesEmpty)
log.Info(LogRoutesEmpty)
p.metrics.IncCounter("routes.empty")

span.SetTag("error", true)
span.LogKV(
"event", "error",
"message", LogRoutesEmpty,
)
span.SetTag("routes.count", routesCount)
case routesCount > 0:
routesBytes, routesHash, initialized, updated := p.b.formatAndSet(routes)
logger := log.WithFields(log.Fields{"count": routesCount, "bytes": routesBytes, "hash": routesHash})
Expand Down

0 comments on commit 1045666

Please sign in to comment.