-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
enhancementA general enhancementA general enhancementinstrumentationAn issue that is related to instrumenting a componentAn issue that is related to instrumenting a componentmodule: micrometer-coreAn issue that is related to our core moduleAn issue that is related to our core module
Milestone
Description
Describe the bug
When using Micrometer to collect metrics from an ExecutorService, I wrap it with ExecutorServiceMetrics.monitor. In the framework logic that I use, the original ExecutorService shuts down if it is not used for some time, and then it is recreated as needed. After it is recreated, metrics are not collected from it because it is created with the exact same name, and all methods like ThreadPoolExecutor::getCorePoolSize are called on the ThreadPoolExecutor that has already been shut down. I have created a PR with a test for this problem and a potential fix.
Environment
- Micrometer version 1.13.1
- Micrometer registry statsd
- OS: Linux
- Java version: 21.0.1
To Reproduce
How to reproduce the bug:
- Wrap an
ExecutorServicewithExecutorServiceMetrics.monitor. - Allow the shutdown.
- Recreate the ExecutorService.
- Observe that metrics are not being collected.
Expected behavior
Metrics should continue to be collected from the recreated ExecutorService.
Additional context
Metadata
Metadata
Assignees
Labels
enhancementA general enhancementA general enhancementinstrumentationAn issue that is related to instrumenting a componentAn issue that is related to instrumenting a componentmodule: micrometer-coreAn issue that is related to our core moduleAn issue that is related to our core module