-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Description
The WebMvcMetricsFilter uses the HandlerMapping.BEST_MATCHING_HANDLER_ATTRIBUTE to determine which handler the metric should be labeled with.
Since useTrailingSlashMatch is true by default most mvc controllers configured with a request mapping like:
@GetMapping(path = "/foo", produces = {MediaType.APPLICATION_JSON_VALUE})will match both /foo and /foo/ and as a result BEST_MATCHING_HANDLER_ATTRIBUTE for this request mapping can have 2 values.
This leads to split metrics for the same request mapping: one for /foo and one for /foo/.
For now I have worked around this with a MeterRegistryCustomizer that strips the trailing slash, but I wonder if this does not deserve a more structural solution, e.g inside the metrics filter itself.
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement