Skip to content

WebMvcTags always reports "root" as uri when servlet Filter handles the request #17147

@jkuipers

Description

@jkuipers

This in relation to #13064 (comment), where Phil asked me to create a new issue.

In a Spring-MVC Boot app, http.server.requests metrics are always reported with a root uri if the request, which would be mapped to Spring-MVC controller under normal circumstances, is handled by a servlet Filter instead. This happens for example when using Spring Security.
The reason is that the WebMvcTags uses the path info of the request in these situations, which is always null because the DispatcherServlet is mapped as a default servlet: the whole path is then present in the servlet path instead.

I would suggest to revisit the class to use the servlet path instead to have more reliable metrics. Per Phil's request I've attached a simple project to demonstrate the current behavior.
root-uri-demo.zip

Metadata

Metadata

Assignees

Labels

status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions