-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Span wasn't started - an observation must be started (not only created)" (Micrometer) due to observation handling in Spring Security Web? #14445
Comments
We have the same issue which is really annoying since it spams our monitoring and alerting system in Prod.
|
@jzheaux might be able to support here. Thanks in advance! |
Thanks, @janekbettinger, for the reproducer. Please try with the latest fix, which is available in the |
Thanks for the fix, @jzheaux, it looks very reasonable! With the sample application and |
Hi @jzheaux , We were facing the issue: Currently, the spring boot version we are using is 3.1.2. Could you confirm in which version of spring boot this issue is fixed along with its micrometer version? |
Hi @sfotedar995, Spring Security 6.2.2 which includes the fix is shipped with Spring Boot (security starter) 3.2.3. |
Hi @janekbettinger not with spring boot version 3.2.1 ?? |
It's also included in Spring Security 6.1.7, which comes with Spring Boot 3.1.9, see https://github.com/spring-projects/spring-boot/releases/tag/v3.1.9. |
Still happening in our application with Spring-Boot 3.2.5 and Security 6.2.4 |
Describe the bug
In all of our Spring WebFlux-based applications having integrated Spring Security Web and Micrometer, we sporadically see the following exception:
(full stacktrace)
It mainly happens on
/actuator/health
calls, but not exclusively. E.g. with Spring Cloud Gateway we randomly see this exceptions on non-routable routes as well. Closed connections can provoke the behavior as well.The issue might be caused by the
Observation
handling by Spring Security Web ino.s.security.web.server.ObservationWebFilterChainDecorator
. Replacingstart()
withclose()
in theonSuccess
handler of theWebFilterChain
wrapper seems to prevent the failure.Related issues
To Reproduce
Follow the README.md in the minimal, reproducible sample linked below.
Expected behavior
Only started observations should be stopped.
Sample
https://github.com/janekbettinger/micrometer-spring-security-sample
spring-security-web:6.2.1
spring-boot-starter-webflux:3.6.1
io.micrometer:micrometer-observation:1.12.1
The text was updated successfully, but these errors were encountered: