feat(jobs): expose last job failure time

JobActivity 记录最近失败时刻并进入快照;JobRunner 失败时上报该时刻;新增指标 msgx.pipeline.job.last_failure_age_seconds 与健康明细 lastFailureAgeSeconds(对齐 reference 作业健康口径)。

验证:./gradlew test 145 tests / 0 fail / 0 skipped。
This commit is contained in:
windyboy
2026-09-12 20:56:41 +08:00
parent 8a380c7646
commit 267eb20219
6 changed files with 22 additions and 6 deletions
@@ -45,6 +45,7 @@ internal fun jobRunnerHealth(snapshot: JobActivity.Snapshot, now: Instant): Heal
"started" to snapshot.started,
"lastTickAgeSeconds" to (ageSeconds ?: -1L),
"lastTickDurationMs" to snapshot.lastTickMillis,
"lastFailureAgeSeconds" to (snapshot.lastFailureAt?.let { Duration.between(it, now).seconds } ?: -1L),
"ticks" to snapshot.ticks,
"failures" to snapshot.failures,
"lastSweepSelected" to snapshot.lastSweepSelected,