You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of Spring Boot 3.0, the Micrometer metrics support has been deprecated/removed in favor of broader observability support in Spring projects directly. In the case of Spring MVC and Spring WebFlux, specific filters (like ServerHttpObservationFilter) were created in Spring Framework 6.0.
The filters have been implemented in a generic fashion and do not rely on web frameworks specifics. This means that instead of looking into web frameworks internals to know which mapping pattern matched the incoming request, the framework itself needs to provide this information.
More concretely, in Spring Boot 2.x, WebMvcTags and WebFluxTags needed to know about Spring Data REST internals to pick up the matching pattern. With the new infrastructure, things should be done the other way around: Spring Data REST should get the current observation, if present, and set the matching path like this. I guess this should be done in RepositoryRestHandlerMapping and the reactive variant as well?
It looks like the original arrangement (looking up a repository-specific pattern like /somRepo/{id} from a request attribute)stemmed from this ticket. Essentially, users were trying to gather metrics by "HTTP resources exposed per repository" rather than from the general pattern (/{repository}/…) which standard MVC-pattern-based metrics would resolve in. Thus, we need to register the same augmented pattern as path pattern on the ServerRequestObservationContext.
The standard Spring MVC observability integration registers the plain request pattern for observations. For our repository controllers that would result in one pattern registered for all individual repository resources (e.g. /{repository}/{id} etc.). However, the insights users would like to gain rather follows the individual repositories exposed. That's why we have so far exposed repository specific path pattern (/myrepo/{id}) via a custom request attribute. To adhere to the new observability integration of Spring Framework 6, we need to expose that particular pattern on the ServerRequestObservationContext, too.
Fixes#2212.
As of Spring Boot 3.0, the Micrometer metrics support has been deprecated/removed in favor of broader observability support in Spring projects directly. In the case of Spring MVC and Spring WebFlux, specific filters (like
ServerHttpObservationFilter
) were created in Spring Framework 6.0.The filters have been implemented in a generic fashion and do not rely on web frameworks specifics. This means that instead of looking into web frameworks internals to know which mapping pattern matched the incoming request, the framework itself needs to provide this information.
More concretely, in Spring Boot 2.x,
WebMvcTags
andWebFluxTags
needed to know about Spring Data REST internals to pick up the matching pattern. With the new infrastructure, things should be done the other way around: Spring Data REST should get the current observation, if present, and set the matching path like this. I guess this should be done inRepositoryRestHandlerMapping
and the reactive variant as well?Sorry for not noticing this before, this has been reported in spring-projects/spring-boot#33673
The text was updated successfully, but these errors were encountered: