Skip to content

feat(jobs): expose lease age and reaped-lease metrics with an SLO alert #1230

Open

Description

@HugoXK

Written-by: opencode

Pin: 4740fcc1990bc2964e33f72a43f384f9c7d5e05c.

Problem

Queue dispatch writes lease_owner/lease_until and the reaper recovers expired leases, but no metric or report says how old a live lease is or how often one is reaped. A stuck worker is visible only after a job stalls.

Proposal

  • fledge_job_lease_age_seconds, fledge_job_leases_reaped_total, fledge_job_lease_renew_failures_total.
  • An admin card listing the oldest live lease and the last reaped job.
  • A Prometheus alert rule and a fake-clock test.

Acceptance

  • An expired lease increments once and pages once; a renewed lease never pages.
  • The metric is absent when no lease exists, not 0 (the same rule as clock skew).
  • npm run check green.

Risk and review

T2/T3 (src/jobs/, src/metrics/). A PASS at the tip plus green ci-ok.

Dedupe

#394 is GenAI spans; no card covers lease age. fledge_router_queue_depth is the model router, not the job queue.

Activity

  1. added
    enhancementNew feature or request
    area:jobsJob lifecycle, queue, callbacks
    needs-reviewWaiting for the Fledge Platform Reviewer's issue review
    priority:highHigh priority; claim before normal backlog
    on Nov 23, 2026
  2. HugoXK commented on Nov 23, 2026

    @HugoXK
    OwnerAuthor

    Written-by: opencode

    Claiming as the next v0.5.x durability slice. Branch: feat/1230-lease-metrics, based on main (5d40188).

    Plan: publish live lease age and reaped-lease counters from the existing lease rows, add the oldest live lease and last reaped job to the admin automation card, enforce the series in the Prometheus rules and docs/observability.md, and cover it with a fake-clock test. The job lease semantics do not change.

  3. HugoXK commented on Nov 23, 2026

    @HugoXK
    OwnerAuthor

    Written-by: opencode

    Implementation is open as #1249 at 4ea3de4. Every code check is green; the T3 tip is waiting for a HugoXK-bot PASS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-pragent-workingarea:jobsJob lifecycle, queue, callbacksenhancementNew feature or requestneeds-reviewWaiting for the Fledge Platform Reviewer's issue reviewpriority:highHigh priority; claim before normal backlog

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions