Skip to content

Micrometer "enable" annotations property does not cover observed aspect #45599

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

Closed
ggsurrel opened this issue May 19, 2025 · 4 comments
Closed
Labels
status: superseded An issue that has been superseded by another type: bug A general bug

Comments

@ggsurrel
Copy link

I am working on a large project with some AOP in it, and evaluating pointcuts can be a bit lenghty when starting the application. So I would like to get rid of the unused ones.

In order to do this, it would be nice to have a way to disable ObservedAspectConfiguration: the class is package protected so I cannot exclude it from the autoconfiguration, and there is no ConditionalOnProperty annotation on it either.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 19, 2025
@bclozel bclozel added this to the 3.4.6 milestone May 19, 2025
@bclozel bclozel added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels May 19, 2025
@bclozel
Copy link
Member

bclozel commented May 19, 2025

It looks like we missed the ObservedAspect when we took care of #39128. I think it's fair to assume that management.observations.annotations.enabled=false should do this already.

@bclozel bclozel changed the title Add a way to disable ObservedAspectConfiguration Micrometer "enable" annotations property does not cover observed aspect May 19, 2025
@nosan
Copy link
Contributor

nosan commented May 19, 2025

@ggsurrel
As a temporary solution, you can register your own BeanDefinitionRegistryPostProcessor to exclude ObservedAspect:

    @Bean
    static BeanDefinitionRegistryPostProcessor excludeObservedAspect() {
        return (registry) -> {
            if (registry.containsBeanDefinition("observedAspect")) {
                registry.removeBeanDefinition("observedAspect");
            }
        };
    }

@jidonghao001
Copy link

good idea

@bclozel
Copy link
Member

bclozel commented May 19, 2025

Superseded by #45601

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2025
@bclozel bclozel removed this from the 3.4.6 milestone May 19, 2025
@bclozel bclozel added the status: superseded An issue that has been superseded by another label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

No branches or pull requests

5 participants