Continuum.Health (continuum v0.6.2)

Copy Markdown View Source

Read-only operational health reporting and explicitly fenced repairs.

report/1 is the shared source for mix continuum.health and the Observer health panel. It reports partition coverage, workflow registration drift, active-run wait reasons, durable wake and timer lag, leases, activities, and signal backlog.

repair/3 is a dry run unless execute: true is passed. Mutating actions compare the lease epoch/owner or activity attempt/owner observed by the operator, so a stale repair cannot overwrite newer runtime authority.

Summary

Functions

Returns true when a health report contains an actionable degradation.

Plans or executes one operational repair.

Builds an operational health report for a PostgreSQL-backed instance.

Types

repair_action()

@type repair_action() ::
  :wake | :retry | :release_expired_lease | :requeue_activity | :mark_reviewed

Functions

degraded?(map)

(since 0.6.2)
@spec degraded?(map()) :: boolean()

Returns true when a health report contains an actionable degradation.

repair(action, subject_id, opts \\ [])

(since 0.6.2)
@spec repair(repair_action() | binary(), binary(), keyword()) ::
  {:ok, map()} | {:error, term()}

Plans or executes one operational repair.

Supported actions:

  • :wake — arm and route a run wake; requires :lease_token.
  • :retry — retry durable registration for a loaded workflow version.
  • :release_expired_lease — release only an expired run lease; requires :lease_owner and :lease_token.
  • :requeue_activity — requeue only an expired activity claim; requires :lease_owner and :attempt.
  • :mark_reviewed — acknowledge a finding fingerprint; requires :finding_type and :fingerprint.

Every action defaults to a dry run. Pass execute: true only after reviewing the returned plan.

report(opts \\ [])

(since 0.6.2)
@spec report(keyword()) :: {:ok, map()} | {:error, term()}

Builds an operational health report for a PostgreSQL-backed instance.

Options include :instance or :repo, :partition_months (default 3), :lost_wake_after_ms (default 60 seconds), and :limit for candidate lists.