-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
status: need-help-to-reproduceIssues that we welcome the community to help us reproduceIssues that we welcome the community to help us reproducestatus: waiting-for-reporterIssues for which we are waiting for feedback from the reporterIssues for which we are waiting for feedback from the reportertype: bug
Description
I have a Spring Boot 2.5.2 app with spring-batch-4.3.3
The app has a multi-step job and a custom JobStatusReportingListener
@Component
public class JobStatusReportingListener implements JobExecutionListener {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Override
public void beforeJob(JobExecution jobExecution) {
}
@Override
public void afterJob(JobExecution jobExecution) {
List<StepExecution> failedSteps = jobExecution
.getStepExecutions()
.stream().filter(v -> !v.getExitStatus().equals(COMPLETED))
.collect(Collectors.toList());
if (!failedSteps.isEmpty()) {
jobExecution.setStatus(BatchStatus.FAILED);
jobExecution.setExitStatus(ExitStatus.FAILED);
logger.error("Job failed on steps {}", failedSteps);
}
}
}The problem is that metrics at actuator/metrics/spring.batch.job doesn't contain tags with status="FAILED" that is set by JobExecutionListener
Metadata
Metadata
Assignees
Labels
status: need-help-to-reproduceIssues that we welcome the community to help us reproduceIssues that we welcome the community to help us reproducestatus: waiting-for-reporterIssues for which we are waiting for feedback from the reporterIssues for which we are waiting for feedback from the reportertype: bug