AI REVIEWED
Module: spring-boot-starter
File: spring/metrics/MigrationMetrics.java (~line 270)
Severity: Medium
Summary
recordSuccess() records the version span metric, but recordFailure() does not. This creates inconsistent metrics — you can't correlate failure rates with migration span size.
Suggested Fix
Record version span in both success and failure paths:
public void recordFailure(String domain, int fromVersion, int toVersion, Throwable error) {
final int span = Math.abs(toVersion - fromVersion);
getOrCreateVersionSpan(domain).record(span);
getOrCreateFailureCounter(domain, classifyError(error)).increment();
}