Disable actuator http observations#36455
Disable actuator http observations#36455jonatan-ivanov wants to merge 2 commits intospring-projects:mainfrom
Conversation
cfb70fb to
f37c5f0
Compare
| management.endpoints.jackson.isolated-object-mapper=true | ||
| spring.jackson.visibility.field=any | ||
|
|
||
| #management.tracing.sampling.probability=1.0 |
There was a problem hiding this comment.
I left these changes in samples intentionally in the PR (it's a separate commit), one the PR is ready to merge I will drop it.
|
I flagged this for team-meeting, as we need to discuss the following:
|
6dd92ed to
9563ba7
Compare
9563ba7 to
f79d931
Compare
vpavic
left a comment
There was a problem hiding this comment.
I tried to add the code from ActuatorWebEndpointObservationConfiguration to one of my projects (Spring Boot 3.1.2 based) and I was greeted by a bean dependency cycle:
webMvcObservationFilter defined in class path resource [org/springframework/boot/actuate/autoconfigure/observation/web/servlet/WebMvcObservationAutoConfiguration.class]
┌─────┐
| observationRegistry defined in class path resource [org/springframework/boot/actuate/autoconfigure/observation/ObservationAutoConfiguration.class]
↑ ↓
| actuatorWebEndpointObservationPredicate defined in class path resource [.../infrastructure/observation/ObservationConfiguration.class]
↑ ↓
| pathMappedEndpoints defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.class]
↑ ↓
| quartzEndpoint defined in class path resource [org/springframework/boot/actuate/autoconfigure/quartz/QuartzEndpointAutoConfiguration.class]
↑ ↓
| liquibase defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]
└─────┘
Not sure if the same happens with the current main and related code being a part of auto-configuration but just a hint to look into it.
| WebMvcProperties webMvcProperties, PathMappedEndpoints pathMappedEndpoints) { | ||
| return (name, context) -> { | ||
| if (context instanceof ServerRequestObservationContext serverContext) { | ||
| String endpointPath = getEndpointPath(serverProperties, webMvcProperties, pathMappedEndpoints); |
There was a problem hiding this comment.
Since endpoint path doesn't change in runtime, I think it doesn't need to be resolved on each invocation of the predicate but rather only once when the predicate is set up.
| PathMappedEndpoints pathMappedEndpoints) { | ||
| return (name, context) -> { | ||
| if (context instanceof ServerRequestObservationContext serverContext) { | ||
| String endpointPath = getEndpointPath(webFluxProperties, pathMappedEndpoints); |
|
Will that be part of the next 3.2.x release? |
|
I doubt it. There are technical subtleties we need to solve before this lands in a Spring Boot release. But hey, never say never. |
|
We're not happy with all the string concatenation and matching going on here. A better way to solve this would be to cancel the observation when an actuator endpoint has been hit. AFAIK there's no way to do that right now, so I've opened micrometer-metrics/micrometer#4061 to discuss this possibility with the Micrometer team. Let's see what they think about that idea. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
We discussed this again today on our call and we feel like we need to wait until micrometer-metrics/micrometer#4061 has been resolved. Given where we are with the Spring Boot 3.x line, I'm going to close this one for now. I think we'll need to reconsider things after 4.0 has been released. |
See: #34801