-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Add metrics support for ThreadPoolTaskExecutor and ThreadPoolTaskScheduler #23818
Comments
Thanks for the suggestion. I think it would be worthwhile to have a |
I agree @snicoll it makes sense to me. thanks a lot |
My approach seems to be wrong @snicoll I also notice that it added a lot of warnings
Something like this is helping
I still have the post processing errors but the the default metrics are back |
@aheritier yes, we're not going to implement that feature this way. Spring Boot rather injects the component (i.e. thread pool) later on and register metrics on it, which avoids causing unnecessary early initialisations due to the dependency on the |
It's good I better understand now. Because I also implements |
I've added a proposal in 910e14f. Unfortunately, it is too late for |
Awesome. Thanks a lot @snicoll |
@snicoll I imported your code in my 2.5.x codebase and it's working fine. |
Thanks for testing Arnaud. Your feedback on the bean type is interesting, I might improve the auto-configuration to take that into account transparently. |
yes not sure if you can make it transparent. For sure I was a bit confused because it wasn't working at the beginning with my Executors then I read the code and the doc to understand that using ThreadPoolTaskExecutor was the solution |
@snicoll I have a question after reading 910e14f. I need to use the TimedExecutorService returned by |
Those two are unrelated, I think. You can give |
@snicoll Hi, what's eventually the status of it? Is there a documentation on how to properly setup monitoring of task executors? |
Yes this has been available since 2.6.0. |
Micrometer allows to monitor the executor states using
ExecutorServiceMetrics
ref: https://github.com/micrometer-metrics/micrometer/blob/master/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java
It allows to monitor the usage of executors with metrics like:
To achieve that we have to wrap our executors with something like this:
(I am creating the tags from
MetricsProperties#getTags
)It might be great if an AutoConfiguration could do it magically (it's why we love Spring-Boot). Not sure how it could be implemented in a Spring-Boot way properly.
We can find such request in various places:
cc @snicoll
The text was updated successfully, but these errors were encountered: