ruler.evaluation.query_frontend gRPC client message size appears configurable via flags only, not via YAML and limits to 4MiB
Describe the bug Hello, I am running loki 3.7.3 and using the ruler to aggregate netflow logs to metrics. however i receive these error messages very frequently. So I asked AI to understand the issue and it seems to be a 4MB limit because the variable has different syntax or is not available in the YAML configuration and does not use the configured limit from the loki.yml.
This is the AI summary:
rule evaluation failed: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (5054383 vs. 4194304)
This happens on the remote evaluation path of the ruler.
From the code, the relevant parts seem to be:
Loki:
pkg/ruler/evaluator_remote.go
especially:
DialQueryFrontend()
QueryFrontendConfig
(*RemoteEvaluator).query()
dskit:
grpcclient/grpcclient.go
especially:
type Config struct
RegisterFlagsWithPrefix()
CallOptions()
DialOption()Relevant source files:
https://github.com/grafana/loki/blob/main/pkg/ruler/evaluator_remote.go https://github.com/grafana/dskit/blob/main/grpcclient/grpcclient.go
QueryFrontendConfig embeds grpcclient.Config:
type QueryFrontendConfig struct {
Address string `yaml:"address"`
ClientConfig grpcclient.Config `yaml:",inline"`
} and registers flags via:
c.ClientConfig.RegisterFlagsWithPrefix("ruler.evaluation.query-frontend", f)
However, in our setup, YAML fields like these are rejected:
ruler:
evaluation:
query_frontend:
max_recv_msg_size: 16777216
max_send_msg_size: 16777216
grpc_compression: snappy
connect_timeout: 5s with errors like:
field max_recv_msg_size not found in type ruler.QueryFrontendConfig
field max_send_msg_size not found in type ruler.QueryFrontendConfig
field grpc_compression not found in type ruler.QueryFrontendConfig
field connect_timeout not found in type ruler.QueryFrontendConfig At the same time, the corresponding CLI flags appear to exist:
-ruler.evaluation.query-frontend.grpc-max-recv-msg-size
-ruler.evaluation.query-frontend.grpc-max-send-msg-size So it looks like the gRPC client settings for ruler.evaluation.query_frontend are exposed via flags, but not actually accepted via YAML config.
Could you please clarify whether this is expected?
If not, it seems something is missing around YAML unmarshalling / inlining for QueryFrontendConfig and its embedded grpcclient.Config.
It would be helpful if the same settings supported by flags were also supported in YAML for:
ruler.evaluation.query_frontend.max_recv_msg_size
ruler.evaluation.query_frontend.max_send_msg_sizeand related embedded grpcclient.Config fields
To Reproduce Steps to reproduce the behavior:
- Start Loki 3.7.3 with monolithic mode and ruler + remote
evaluation: mode: remote max_jitter: 0s query_frontend: address: dns:///fm1lo.sub.domain.de:9097 tls_enabled: false tls_cert_path: "" tls_key_path: "" tls_ca_path: "" tls_server_name: "" tls_insecure_skip_verify: false tls_cipher_suites: "" tls_min_version: ""
3. Big queries or remote rule executions fail.
**Expected behavior**
A parameter to configure this limit in the yaml.
**Environment:**
- Infrastructure: Baremetal, monolithic mode
- Deployment tool: binary
**Screenshots, Alloy config, or terminal output**
N/ASource: grafana/loki