Closed
Description
As of 5.0.0-RC1
, the ObservationRegistry
used by Micrometer is statically defined and configured: https://github.com/spring-projects/spring-batch/blob/5.0.0-RC1/spring-batch-core/src/main/java/org/springframework/batch/core/observability/BatchMetrics.java#L61-L67.
This prevents users from adding custom handlers like a tracing one for example: https://github.com/micrometer-metrics/micrometer-samples/blob/main/batch/src/main/java/com/example/micrometer/ManualConfiguration.java
The goal of this issue is to remove the static configuration and implement a bean post processor that automatically sets the user's observation registry on observable batch artifacts (jobs, steps, etc).