runtime config "re2.max_program_size.error_level" doesn't apply to stats matcher
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 430
Description
*Title*: runtime flag "re2.max_program_size.error_level" doesn't apply to stats_matcher config
*Description*:
I have this simple envoy config
```
{
"admin": {
"access_log_path": "/dev/null",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 8001
}
}
},
"layered_runtime": {
"layers": [
{
"name": "static-runtime",
"static_layer": {
"re2.max_program_size.error_level": 1000
}
}
]
},
"stats_config": {
"stats_matcher": {
"inclusion_list": {
"patterns": [
{
"safe_regex": {
"google_re2": {},
"regex": "cluster.(metadata-cluster|iam-cluster|service-control-cluster|backend-cluster-sample-backend-s3fctubhaq-uc.a.run.app_443).upstream_rq_(reset|timeout|[1-5]xx)"
}
}
]
}
}
}
}
```
Envoy failed to load it with following error:
```
2022-04-27 12:21:28.927][1601282][critical][main] [external/envoy/source/server/server.cc:117] error initializing configuration '/tmp/envoy333.json': regex 'cluster.(metadata-cluster|iam-cluster|service-control-cluster|backend-cluster-sample-backend-s3fctubhaq-uc.a.run.app_443).upstream_rq_(reset|timeout|[1-5]xx)' RE2 program size of 187 > max program size of 100 set for the error level threshold. Increase configured max program size if necessary.
[2022-04-27 12:21:28.927][1601282][info][main] [external/envoy/source/server/server.cc:939] exiting
regex 'cluster.(metadata-cluster|iam-cluster|service-control-cluster|backend-cluster-sample-backend-s3fctubhaq-uc.a.run.app_443).upstream_rq_(reset|timeout|[1-5]xx)' RE2 program size of 187 > max program size of 100 set for the error level threshold. Increase configured max program size if necessary.
```
It seems that `layered_runtime` runtime is applied after `stats_matcher`. so its flag of ""re2.max_program_size.error_level" to 1000 was not applied.
It happens with top of tree, release 1.22.0
But it did not happen with release 1.21.1
*Repro steps*:
Contributor guide
Assessment
This issue has not been assessed yet.