You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked to make sure that this issue has not already been filed
Proposal
I am using db-scheduler-spring-boot-starter.
It would be great if default ExecutorService (i.e. workers thread pool) could automatically be attached to micrometer metrics for executors.
Example metrics, which are automatically registered for two default spring's thread pools (for @Async and @Scheduled):
One could take spring's executor (e.g. applicationTaskExecutor) and use it as db-scheduler worker ExecutorService via DbSchedulerCustomizer.executorService()
Thoughts
It seems like ExecutorService was intentionally not exposed as a bean, which possibly prevents it from being registered by TaskExecutorMetricsAutoConfiguration.
Bonus idea: metric returning overdue task count by names
Motivation
With ExecutorService's metrics users could monitor scheduler's load
Context
DB-Scheduler Version : 14.0.3 (I also checked what's new in current newest 14.1.0)
@Configuration(proxyBeanMethods =false)
classDbSchedulerConfig(
privatevalapplicationTaskExecutor:ThreadPoolTaskExecutor
) {
@Bean
fundbSchedulerCustomizer(): DbSchedulerCustomizer=object:DbSchedulerCustomizer {
// this is needed to register executor service metrics for db-scheduleroverridefunexecutorService(): Optional<ExecutorService> {
returnOptional.of(applicationTaskExecutor.threadPoolExecutor)
}
}
}
application.yml
spring:
task:
execution: # ! used as db-scheduler pool !pool:
core-size: 9max-size: 9allow-core-thread-timeout: falsethread-name-prefix: task-executor-shutdown:
await-termination: trueawait-termination-period: PT4M # just in case, same as db-scheduler.shutdown-max-waitdb-scheduler:
# removed thread number settingimmediate-execution-enabled: trueshutdown-max-wait: 240s# 4 minutes
Prerequisites
Proposal
I am using db-scheduler-spring-boot-starter.
It would be great if default ExecutorService (i.e. workers thread pool) could automatically be attached to micrometer metrics for executors.
Example metrics, which are automatically registered for two default spring's thread pools (for
@Async
and@Scheduled
):These executors are exposed as beans and connected to MeterRegistry in TaskExecutorMetricsAutoConfiguration.
So scheduler's ExecutorService could be added as well:
Workaround
One could take spring's executor (e.g. applicationTaskExecutor) and use it as db-scheduler worker ExecutorService via DbSchedulerCustomizer.executorService()
Thoughts
It seems like ExecutorService was intentionally not exposed as a bean, which possibly prevents it from being registered by TaskExecutorMetricsAutoConfiguration.
Bonus idea: metric returning overdue task count by names
Motivation
With ExecutorService's metrics users could monitor scheduler's load
Context
Involved classes:
The text was updated successfully, but these errors were encountered: