Something went wrong. Try again.
A Kubernetes operator that runs Claude Code sessions on long-horizon work
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122# The alerts on the operator's metrics. plans/operator-build.md names# the metrics. Each summary is a static phrase with no final period,# so it works as the title of a notification.apiVersion: monitoring.coreos.com/v1kind: PrometheusRulemetadata: name: simmer namespace: simmerspec: groups: - name: simmer rules: # The andon cord: a Session or a person created a Stop, and the # operator starts no Job until the cluster owner deletes it. # There is no for, so the alert fires at the next evaluation. - alert: SimmerStopped expr: simmer_stopped == 1 labels: severity: warning annotations: summary: "simmer is stopped" description: >- A Stop holds, so simmer starts no Job. `kubectl get stops` shows the reason and the Session that created it. Delete the Stop to start simmer again.
# A Hold keeps a Duty's events, and only a person releases or # drops them. The alert fires while the Hold exists, whatever # its count, as SimmerStopped fires while a Stop exists, so a # Hold that a Session created to pause a Duty fires too. Its # value is the Duty's held events; a Hold of a Duty that does not # exist reads 0. There is no for, so a burst that reaches the # limit fires at the next evaluation. A release or a drop ends # it: SimmerHoldFailing watches those. - alert: SimmerDutyHeld expr: | (simmer_duty_held_events and on (namespace, duty) simmer_hold{disposition="Hold"}) or on (namespace, duty) (simmer_hold{disposition="Hold"} * 0) labels: severity: warning annotations: summary: "A simmer Duty is held" description: >- A Hold keeps the events of the Duty {{ $labels.namespace }}/{{ $labels.duty }} that would start its Sessions, and holds {{ $value | humanize }} of them now. `kubectl describe hold -n {{ $labels.namespace }} {{ $labels.duty }}` gives the reason. Set its disposition to Release to start Sessions from them at the Duty's burst limit, or to Drop to delete them: `kubectl patch hold -n {{ $labels.namespace }} {{ $labels.duty }} --type merge -p '{"spec":{"disposition":"Release"}}'`.
# The operator's last attempt to release or drop a Hold's events # failed. Each pass tries again, and the for lets a passing error # clear before anyone is told. A release that waits on the burst # limit or on the Duty's Ready attempts nothing, so it does not # fire. - alert: SimmerHoldFailing expr: simmer_hold_failing == 1 for: 15m labels: severity: warning annotations: summary: "A simmer Hold's release or drop fails" description: >- The operator has failed for 15 minutes to {{ if eq $labels.disposition "Drop" }}drop{{ else }}release{{ end }} the held events of the Duty {{ $labels.namespace }}/{{ $labels.duty }}. `kubectl describe hold -n {{ $labels.namespace }} {{ $labels.duty }}` gives the error in its Holding condition. The operator's logs name it too.
- alert: SimmerSignalDisconnected expr: simmer_signal_connected == 0 for: 15m labels: severity: warning annotations: summary: "A simmer Signal is disconnected from wicket" description: >- The Signal {{ $labels.signal }} has had no subscription to wicket for 15 minutes, so its events do not reach simmer. `kubectl describe signal {{ $labels.signal }}` shows the reason.
- alert: SimmerReconcileErrors expr: sum by (kind) (rate(simmer_reconcile_errors_total[5m])) > 0 for: 15m labels: severity: warning annotations: summary: "simmer fails to reconcile its resources" description: >- The operator has had errors reconciling {{ $labels.kind }} for 15 minutes. The operator's logs name each object and its error.
# More failed turns than succeeded turns over an hour, for a # Mandate with at least 3 failures, so one failed turn of a quiet # Mandate does not fire. - alert: SimmerTurnsFailing expr: | sum by (namespace, mandate) (increase(simmer_turns_total{outcome="Failed"}[1h])) > sum by (namespace, mandate) (increase(simmer_turns_total{outcome="Succeeded"}[1h])) and sum by (namespace, mandate) (increase(simmer_turns_total{outcome="Failed"}[1h])) >= 3 labels: severity: warning annotations: summary: "Most of a simmer Mandate's turns fail" description: >- The Mandate {{ $labels.namespace }}/{{ $labels.mandate }} had {{ $value | humanize }} failed turns in the last hour, more than its successful turns. `kubectl logs` of its Sessions' Jobs shows each turn.
# A Session whose last 3 turns failed has released its keys and # takes no more events, so its work stops until a person looks. # An increase of failed turns would miss a Session that failed # once and then sat Failed, so the alert reads the phase. - alert: SimmerSessionFailed expr: sum by (namespace, mandate) (simmer_sessions{phase="Failed"}) > 0 labels: severity: warning annotations: summary: "A simmer Session failed" description: >- The Mandate {{ $labels.namespace }}/{{ $labels.mandate }} has {{ $value | humanize }} Sessions whose last 3 turns failed. Each released its keys and takes no more events. `kubectl get sessions -n {{ $labels.namespace }}` lists them, and `kubectl logs` of their Jobs shows each turn. The operator deletes a failed Session after the Mandate's ttlAfterFinished.
# A person signs a Console in once, with kubectl exec, and the # login lasts weeks. The for covers the minutes between a new # Console's first start and its sign-in. - alert: SimmerConsoleLoggedOut expr: simmer_console_logged_in == 0 for: 30m labels: severity: warning annotations: summary: "A simmer Console has no claude.ai login" description: >- The Console {{ $labels.namespace }}/{{ $labels.console }} has had no valid claude.ai login, or no running server, for 30 minutes, so it does not show in the Claude app. `kubectl describe console -n {{ $labels.namespace }} {{ $labels.console }}` gives the command that signs it in.