You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So digging a little bit deeper, it seems that ":9095" requests are still being forwarded to the proxy even with ruler disabled. Only thing is that the backend pod is not complaining about it unless some rules are loaded in the ruler...
Those requests disappear the moment the retention is turned off.
func (t*Loki) compactorAddress() (string, bool, error) {
legacyReadMode:=t.Cfg.LegacyReadTarget&&t.Cfg.isTarget(Read)
ift.Cfg.isTarget(All) ||legacyReadMode||t.Cfg.isTarget(Backend) {
// In single binary or read modes, this module depends on Serverreturnnet.JoinHostPort(t.Cfg.Server.GRPCListenAddress, strconv.Itoa(t.Cfg.Server.GRPCListenPort)), true, nil
}
ift.Cfg.Common.CompactorAddress==""&&t.Cfg.Common.CompactorGRPCAddress=="" {
return"", false, errors.New("query filtering for deletes requires 'compactor_grpc_address' or 'compactor_address' to be configured")
}
ift.Cfg.Common.CompactorGRPCAddress!="" {
returnt.Cfg.Common.CompactorGRPCAddress, true, nil
}
returnt.Cfg.Common.CompactorAddress, false, nil
}
In my case, the backend pod enters the first condition, as the target is "Backend" :
ift.Cfg.isTarget(All) ||legacyReadMode||t.Cfg.isTarget(Backend) {
// In single binary or read modes, this module depends on Serverreturnnet.JoinHostPort(t.Cfg.Server.GRPCListenAddress, strconv.Itoa(t.Cfg.Server.GRPCListenPort)), true, nil
}
The address returned is ":9095", without a hostname, because the grpc_listen_address is set to "" in the configuration.
In distributed architecture mode it works because the compactorAddress is computed from the compactor_grpc_address parameters from the config.
But in SingleBinary and SimpleScalableSetup the GRPC client try to connect to ":9095", falling into the first condition.
And this seems to fail because all requests made to ":9095" seems to ignore the NO_PROXY directive.
Not sure if it's expected.
IMO, when the compactor_grpc_address or compactor_address is defined, then it should be prioritized over the first condition of the compactorAddress() function.
Renaming the Issue according to the latest findings.
rurod
changed the title
Loki forwarding :9095 requests to HTTP Proxy when retention and ruler are activated at the same time
Enabling retention is incompatible with setting up a proxy through env vars in SingleBinary and SimpleScalable modes
Apr 10, 2025
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Loki forwards ":9095" requests to HTTP Proxy when both ruler and retention are enabled.
To Reproduce
Steps to reproduce the behavior:
Issue does not occur if no alerting rule is configured.
Issue disappears if retention is disabled
Error message :
Expected behavior
Environment:
Screenshots, Promtail config, or terminal output
Backend pod logs :
Squid proxy access logs :
SimpleScalableValues.yaml
Ruler rules configmap:
The text was updated successfully, but these errors were encountered: