-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Describe the bug
The documentation for the GatewayMetricsFilter states that:
In addition, through the spring.cloud.gateway.metrics.tags.path.enabled property (by default, false), you can activate an extra metric with the path tag: [...]
The property name is deprecated, but when switching the corresponding property spring.cloud.gateway.server.webflux.metrics.tags.path.enabled to true, the metrics contains a "path" tag whose value is enabled 🙃 .
The cause of the issue is that on one hand, the bean creation is activated by the configuration property spring.cloud.gateway.server.webflux.metrics.tags.path.enabled.
On the other hand, spring.cloud.gateway.server.webflux.metrics.tags is mapped to the GatewayMetricsProperties.tags property, which is a Map of arbitrary tags to add to metrics.
The issue still occurs in v5.x of the gateway.
As a workaround, removing the spring.cloud.gateway.server.webflux.metrics.tags.path.enabled property and creating the GatewayPathTagsProvider bean in the app's configuration works.