Skip to content
Leader docs0.4

Micrometer integration

Latest stable Based on Leader release 0.4.0

Measure election decisions and AOP execution while controlling high-cardinality lock names.

MicrometerLeaderElectionListener records lifecycle decisions from elector events. MicrometerLeaderAopMetricsRecorder instruments annotation-driven execution. Choose the one matching the invocation boundary; avoid double-counting the same call through both without an explicit dashboard model.

Use bounded tags for backend, result, and stable job family. Normalize or reject tenant-rich lock names before turning them into labels. Store exact lock names in structured logs when needed for diagnosis.

Pair rates with duration and backend health. An elected counter alone cannot reveal a stuck action; skipped alone cannot distinguish healthy contention from excessive overlap. The Prometheus example includes an end-to-end scrape and dashboard shape that should be adapted to local naming and alert thresholds.