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
Describe the bug
Scratched my head at this one for awhile. We have some reactive applications and upon upgrading to Spring Boot 3.0.3, we noticed that the ObservationRegistry had zero handlers registered to it. This is because of some kind of early creation of the ObservationRegistry bean that is caused by the @EnableReactiveMethodSecurity.
This post processor is responsible for registering all the observation handlers. When you have an ObservationRegistry without handlers, it effectively becomes a NOOP registry causing all kinds of problems (including 500s in the spring cloud gateway).
To Reproduce
Go to start.spring.io
Create a project with: webflux, actuator, spring-security, and prometheus
Add a configuration class with @EnableReactiveMethodSecurity
For debugging purposes, add a controller which uses the ObservationRegistry, you can then set a breakpoint on the endpoint so you can inspect the ObservationRegistry bean. You will see it has zero handlers registered.
Remove the @EnableReactiveMethodSecurity notice that the handlers are added correctly.
Expected behavior
The @EnableReactiveMethodSecurity should not interfere with the ObservationRegistry
Describe the bug
Scratched my head at this one for awhile. We have some reactive applications and upon upgrading to Spring Boot 3.0.3, we noticed that the
ObservationRegistry
had zero handlers registered to it. This is because of some kind of early creation of theObservationRegistry
bean that is caused by the@EnableReactiveMethodSecurity
.I'm not sure what causes this problem in spring security, but in Spring Boot this would happen if something causes the
ObservationRegistry
bean to be created BEFORE theObservationRegistryPostProcessor
found here: https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfiguration.java#L61-L70This post processor is responsible for registering all the observation handlers. When you have an
ObservationRegistry
without handlers, it effectively becomes aNOOP
registry causing all kinds of problems (including 500s in the spring cloud gateway).To Reproduce
@EnableReactiveMethodSecurity
ObservationRegistry
, you can then set a breakpoint on the endpoint so you can inspect theObservationRegistry
bean. You will see it has zero handlers registered.@EnableReactiveMethodSecurity
notice that the handlers are added correctly.Expected behavior
The
@EnableReactiveMethodSecurity
should not interfere with theObservationRegistry
Sample
TestConfiguration.java
TestController.java
pom.xml
The text was updated successfully, but these errors were encountered: