https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide#aop-starter-pom

AOP Starter POM (...)

If your application does not use AspectJ, typically an annotation in the org.aspectj.lang.annotation package, you probably do not need the starter at all.

I do not have org.aspectj.lang.annotation, I removed the starter at all and annotation io.micrometer.core.annotation.Timed stopped working.

I made PR for that in https://github.com/spring-projects/spring-boot/pull/48258

I think migration guide too carelessly suggests removal of spring-boot-starter-aop/spring-boot-starter-aspectj

Comment From: philwebb

Thanks for the PR, but the situation is a little more nuanced than suggested. I think we'll update the wiki instead to help indicate that AspectJ might still be useful when combined with Micrometer.

Comment From: philwebb

See https://github.com/spring-projects/spring-boot/pull/48258#issuecomment-3568359126 which is a fair point. We should probably add something to the docs as well.

Comment From: snicoll

I've added more details in that section.

Comment From: michaldo

Excuse me, but this issue is closed too early. As mentioned earlier, We should probably add something to the docs as well.

The issue is that documentation says

To enable scanning of observability annotations like @Observed, @Timed, @Counted, @MeterTag and @NewSpan, you need to set the management.observations.annotations.enabled property to true.

Buy should say

... you need to set the management.observations.annotations.enabled property to true and add Advice.class to classpath, because otherwise MetricsAspectsAutoConfiguration.java will not run

Or something like it.