Greetings,

First of all--great product! Good job.

I have been going around and around on a problem. I can create AOP pointcuts to do some metrics and logging and other things on the actuator endpoints. So if I go to 'http://localhost:8080/actuator/*something*' I can use AOP to do all of my programming. But if I go to just 'http://localhost/actuator', then nothing fires and I totally miss the people hitting the root url.

In looking at https://github.com/spring-projects/spring-boot/blob/0a4c26532dff6f3fa1bf6d2e1c2a74549191117a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/WebMvcEndpointHandlerMapping.java#L76, I can see where the URL response body is handled. But because this is not a public inner class, I'm not able to get to it using any of my current programming.

I can understand that you want to keep that hidden, but is there a way to provide some kind of handle or something that I can use with AOP when someone goes to just 'http://localhost:8080/actuator'.

Thanks again for a great project.

Comment From: newbo-2021

If someone has already solved this with Spring AOP, then I'd appreciate simply knowing the pointcut expression to hit that function and I'll withdraw the bug report as solved. I'm very new to AOP, so I'm happy to just know how to get there.

Comment From: wilkinsona

If you want to be able to apply AOP to package-private code, you should use AspectJ and load-time weaving, as described in the Spring Framework reference documentation. That said, I would caution against advising Spring Boot's internals as they may change at any time.

Generally speaking, using an interceptor, such as a Filter in the servlet stack, is a better approach and will work for any request handled by the application. Please see https://github.com/spring-projects/spring-boot/issues/11234 for some more details.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.