Add configuration property to enable micrometer annotations

Prior to this commit, the Micrometer annotations support (`@Timed`,
`@Counted`...) was guarded by the presence of both Micrometer and
AspectJ on the classpath.

This signal is too weak, considering the startup performance impact and
the fact that the AspectJ dependency can be brought transitively in many
cases.

This commit adds a new `micrometer.observations.annotations.enabled`
property that is set to `false` by default to only process the
annotations support when this property is enabled.

Fixes gh-39128
This commit is contained in:
Brian Clozel
2024-01-15 13:51:15 +01:00
parent 8bdaae37b0
commit 46b7bd2f23
9 changed files with 56 additions and 9 deletions

View File

@@ -215,6 +215,7 @@ public class DocumentConfigurationProperties extends DefaultTask {
private void actuatorPrefixes(Config prefix) {
prefix.accept("management");
prefix.accept("micrometer");
}
private void dockerComposePrefixes(Config prefix) {