Skip to content

Commit 4c986f2

Browse files
committed
[gateway] quiet per-translation log spam in HTTPRoute processing
The shared backplane re-runs a full Gateway-API translation every few seconds, and each pass logged an Info line per HTTP filter plus a spurious "No valid HTTP backends" Error for every DirectResponse-backed route (which legitimately has no backendRefs). Together these accounted for ~3 log events/s per edge cluster and pushed the staging namespace into Vector's per-namespace ingest cap. Demote the per-filter line to Debug and only log the no-valid-backends error when the translator actually injects the 500 fallback.
1 parent 593ab11 commit 4c986f2

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

pkg/gateway/gatewayapi/filters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (t *Translator) ProcessHTTPFilters(parentRef *RouteParentContext,
7474
}
7575
for i := range filters {
7676
filter := filters[i]
77-
log.Infof("Processing HTTP filter: %s", filter.Type)
77+
log.Debugf("Processing HTTP filter: %s", filter.Type)
7878
// If an invalid filter type has been configured then skip processing any more filters
7979
if httpFiltersContext.DirectResponse != nil {
8080
log.Warnf("Skipping processing of HTTP filters as a DirectResponse has been configured")

pkg/gateway/gatewayapi/route.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,14 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe
269269
// If the route has no valid backends then just use a direct response and don't fuss with weighted responses
270270
for _, ruleRoute := range ruleRoutes {
271271
noValidBackends := ruleRoute.Destination == nil || ruleRoute.Destination.ToBackendWeights().Valid == 0
272-
if noValidBackends && ruleRoute.Redirect == nil {
272+
// A route that already carries a DirectResponse (e.g. from a
273+
// DirectResponse extension filter) legitimately has no backends,
274+
// so only complain when we have to inject the 500 fallback.
275+
if noValidBackends && ruleRoute.Redirect == nil && ruleRoute.DirectResponse == nil {
273276
log.Errorf("No valid HTTP backends for route %s: destination=%v", ruleRoute.Name, ruleRoute.Destination)
274-
if ruleRoute.DirectResponse == nil {
275-
ruleRoute.DirectResponse = &ir.DirectResponse{
276-
StatusCode: 500,
277-
Body: ptr.To("no valid HTTP backends"),
278-
}
277+
ruleRoute.DirectResponse = &ir.DirectResponse{
278+
StatusCode: 500,
279+
Body: ptr.To("no valid HTTP backends"),
279280
}
280281
}
281282
ruleRoute.IsHTTP2 = false

0 commit comments

Comments
 (0)