envoyproxy / envoyproxy/gateway
Using RegularExpression to filter stats is not working as expected
- Dominant language
- Go
- Stars
- 3k
- Forks
- 864
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 140
Description
*Description*:
When using a regex string that contains character classes starting with `\`, stats are not included in the stats endpoint.
For example, the following regex does not work:
```
^cluster\.\w+\.upstream\w+$
```
*Repro steps*:
Apply the following configuration. It should not work:
```
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
name: public
spec:
telemetry:
metrics:
matches:
- type: RegularExpression
value: ^cluster\.\w+\.upstream\w+$
```
The egctl command reports the following settings for proxies:
```
statsConfig:
statsMatcher:
inclusionList:
patterns:
- safeRegex:
googleRe2: {}
regex: ^cluster\\.\\w+\\.upstream\\w+$
```
The correct configuration should be:
```
statsConfig:
statsMatcher:
inclusionList:
patterns:
- safeRegex:
googleRe2: {}
regex: ^cluster\.\w+\.upstream\w+$
```
*Environment*:
ENVOY_GATEWAY_VERSION: v1.2.5
ENVOY_PROXY_VERSION: distroless-v1.32.3
GATEWAYAPI_VERSION: v1.2.1
GIT_COMMIT_ID: 51a420a03437270d2f90e995b5e0c3da0794e218
GOLANG_VERSION: go1.23.4
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.