Instrument Scheduled methods for observability
This commit enhances the `ScheduledAnnotationBeanPostProcessor` to instrument `@Scheduled` methods declared on beans. This will create `"tasks.scheduled.execution"` observations for each execution of a scheduled method. This supports both blocking and reactive variants. By default, observations are no-ops; developers must configure the current `ObservationRegistry` on the `ScheduledTaskRegistrar` by using a `SchedulingConfigurer`. Closes gh-29883
This commit is contained in:
@@ -11,6 +11,7 @@ dependencies {
|
||||
api(project(":spring-beans"))
|
||||
api(project(":spring-core"))
|
||||
api(project(":spring-expression"))
|
||||
api("io.micrometer:micrometer-observation")
|
||||
optional(project(":spring-instrument"))
|
||||
optional("jakarta.annotation:jakarta.annotation-api")
|
||||
optional("jakarta.ejb:jakarta.ejb-api")
|
||||
@@ -41,6 +42,8 @@ dependencies {
|
||||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
|
||||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
|
||||
testImplementation("io.reactivex.rxjava3:rxjava")
|
||||
testImplementation('io.micrometer:context-propagation')
|
||||
testImplementation("io.micrometer:micrometer-observation-test")
|
||||
testRuntimeOnly("jakarta.xml.bind:jakarta.xml.bind-api")
|
||||
testRuntimeOnly("org.glassfish:jakarta.el")
|
||||
// Substitute for javax.management:jmxremote_optional:1.0.1_04 (not available on Maven Central)
|
||||
|
||||
Reference in New Issue
Block a user