thanos-io/thanos · info
res.GetWarning() (propagated warning)
Error message
res.GetWarning() (propagated warning)
What it means
This is the warning-propagation path of rulesServer.Send: when a RulesResponse carries a Warning, the server collects it into srv.warnings and returns nil instead of treating it as a group. The message 'res.GetWarning() (propagated warning)' labels this code path; no error is thrown here by design.
Solutions
- Check the warnings returned alongside groups and log/act on them
- If rules appear missing, the upstream probably emitted a warning explaining the truncation
- Address the upstream-side condition (e.g. reduce rule count or fix ruler limits)
Defensive patterns
Strategy: type-guard
Type guard
func isWarningResponse(res *rulespb.RulesResponse) bool {
return res.GetWarning() != ""
} Prevention
- Always inspect and log warnings returned with rule groups
- Don't assume the group count equals the upstream rule count when warnings are present
When it happens
Trigger: An upstream ruler streams a rulespb.RulesResponse with the Warning field set (e.g. partial results, rule limit exceeded) while the client consumes the Rules stream.
Common situations: Large rule sets where upstream truncates results; deprecation or limit warnings surfaced by the ruler; callers ignoring resp warnings and seeing fewer rules than expected.
Related errors
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/c6c9532989a1cb1d.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/rules/rules.go:280
}
return groups[:i+1]
}
type rulesServer struct {
// This field just exist to pseudo-implement the unused methods of the interface.
rulespb.Rules_RulesServer
ctx context.Context
warnings annotations.Annotations
groups []*rulespb.RuleGroup
mu sync.Mutex
}
func (srv *rulesServer) Send(res *rulespb.RulesResponse) error {
if res.GetWarning() != "" {
srv.mu.Lock()
defer srv.mu.Unlock()
srv.warnings.Add(errors.New(res.GetWarning()))
return nil
}
if res.GetGroup() == nil {
return errors.New("no group")
}
srv.mu.Lock()
defer srv.mu.Unlock()
srv.groups = append(srv.groups, res.GetGroup())
return nil
}
func (srv *rulesServer) Context() context.Context {
return srv.ctx
}
View on GitHub (pinned to 35b8b99117)