Record HTTP client metrics when spring-security requests OAuth2 resources from an authorization server #31981
Labels
type: enhancement
A general enhancement
Milestone
When including the
spring-boot-starter-oauth2-resource-server
, it would be nice if external requests made by Spring Security were included in the default Micrometer http client metrics. Including these would give visibility and better insight into the performance of the authorization servers.In many cases it might not be too hard to add. For example, the default
JwtDecoder
in theOAuth2ResourceServerJwtConfiguration
is built byNimbusJwtDecoder
which uses it's ownRestTemplate
instance behind the scenes. It looks like theJwkSetUriJwtDecoderBuilder
we use for this already has an option to provide a customRestOperations
. We could use this to set the defaultRestTemplateBuilder
instance to get those metrics with minimal effort.The text was updated successfully, but these errors were encountered: