Event watcher tuning and cost
The event watcher reads the events of every cluster that it watches and calls no model. Tokens are spent when an event becomes an incident. The agent posts one alert, the Planning Agent takes one short turn to file one card, and the Cluster Agent of that cluster runs the diagnosis (Event triage). The token spend that events cause is the number of triage turns a day multiplied by the cost of one triage turn.
This page maps each setting to those two factors. It gives the direction of each effect and no token figure: the cost of one triage turn is not measured here, because it depends on the model, the fault and the cluster. Measure your own install before and after a change.
What an event passes through
Section titled “What an event passes through”An event starts a triage turn only when it passes every step below. Steps 1 to 4 run in the watcher, and the others run in the agent’s session server.
- The watcher watches its cluster: the cluster that the agent runs on, and each cluster in scope that has a Cluster Agent.
- Its reason is on the watcher’s list. The list holds failure reasons, such as crash loops, failed image pulls, out-of-memory kills, failed scheduling and Config Connector reconcile failures. No setting changes the list.
- No alert-exclude rule matches it.
- It has repeated often enough and lasted long enough for its reason, and the watcher has not reported the same object and reason inside the dedup window.
- Its type is
Warning, or it has no type. An event of another type, such asNormal, is counted for the daily recap and starts nothing. - No earlier alert for the same workload folds it in. While the fold is on, the workload also has no open fix pull request for the same fault in one of its recent incidents (One incident per workload).
- The daily alert ceiling for its severity is not spent.
Settings that decide how many events reach the agent
Section titled “Settings that decide how many events reach the agent”| Setting | Default | Effect on noise | Effect on token cost |
|---|---|---|---|
spec.scope |
The clusters of the install’s project | Each cluster in scope adds its events. exclude.clusters takes a cluster out: it gets no Cluster Agent, and the agent can no longer read it. The cluster that the agent runs on is always watched, and only an alert-exclude rule silences it. Set the scope with the chart value platformAgent.scope, or with the SCOPE_* keys of install.env on an install made with install.sh. |
No triage turn for a cluster that the watcher does not watch. |
platformAgent.harness.eventWatcher.alertExclude |
No rules | An event that a rule matches opens no incident, and its cluster stays readable. A rule names a cluster, a namespace, a reason, a kind, a name, or several of them. It is the only setting that leaves one namespace out. A change is in force in about two minutes, with no pod restart. | No triage turn and no share of the daily ceiling for a matching event. |
spec.harness.eventWatcher.enabled |
On | false stops every cluster-event alert on every cluster. It is an emergency stop: a change restarts the agent pod, and the watcher stays off until you set it back. A helm upgrade that removes the last alert-exclude rule also removes the stop. |
No event triage turn while it is off. |
The spec.harness.eventWatcher reference
has the rule syntax, an example, and what the emergency stop leaves running.
Multiple GCP projects says how a cluster in another project
comes into scope.
Settings that decide how long a failure must last
Section titled “Settings that decide how long a failure must last”Each key below is a chart value under platformAgent.deployment.eventWatcher. A change restarts the
agent pod and the credential-proxy pod.
| Key | Default | What it holds back |
|---|---|---|
backoffMinCount |
3 |
A crash loop, until its back-off event has repeated this many times. |
settle |
2m |
A failure that is retried, such as a crash loop or a Config Connector resource that waits for a dependency, until it has lasted this long. "0" turns it off. |
imagePullTransientMinCount |
3 |
A failed image pull that looks temporary, such as a registry rate limit or a timeout, until it has repeated this many times. A wrong image tag alerts at once. |
failedSchedulingMinCount |
5 |
A pod that cannot be scheduled and has no cluster autoscaler verdict, until this many attempts have failed. |
failedSchedulingMinSpan |
2m |
The same pod, until its failed attempts span this long. "0" turns it off. |
scaleUpHold |
15m |
A pod that cannot be scheduled while the cluster autoscaler adds a node for it, for at most this long. |
autopilotScaleToZeroHold |
true |
The system pods of an Autopilot cluster that has scaled to zero nodes. |
dedupWindow |
24h |
A repeat alert for the same object and reason. Each sighting restarts the window, so only a quiet gap longer than the window opens a new incident. |
quietAfter |
15m |
Nothing. After this long with no sighting, the watcher adds one line to the alert’s thread. The line starts no model turn, so the key does not change the cost. |
A higher count or a longer time drops more failures that clear by themselves. That means fewer
alerts and fewer triage turns, and a later alert for a failure that is real. A lower value does the
opposite. A shorter dedupWindow makes a failure that repeats slowly open a new incident each time,
and each new incident is a new triage turn.
Read the watcher’s counters before you raise a value. k8s_event_watcher_events_filtered_total
counts each event that a rule of steps 2 to 4 holds back, with the rule in the gate label. The
dedup window has its own counter, k8s_event_watcher_events_deduped_total. Together they show which
rule already drops the events and which one lets them pass. The
chart README
has the value formats, and the
watcher README
describes each rule in full.
Settings that decide how many incidents get a triage turn
Section titled “Settings that decide how many incidents get a triage turn”| Setting | Default | Effect on noise | Effect on token cost |
|---|---|---|---|
platformAgent.deployment.incidentWorkloadDedupSeconds |
3600 |
The pods and the reasons of one broken workload make one alert inside the window. A Critical event after a Warning alert is announced again. 0 gives each pod and each reason its own alert. |
One triage turn for the workload inside the window, and one more if it gets worse. |
platformAgent.deployment.alertDailyLimits |
critical: 10, warning: 5 |
An upper limit on the cluster-event alerts of each UTC day, for all the clusters together. An alert over the limit does not reach chat. | The same upper limit on event triage turns. It does not grow with the number of clusters. |
INCIDENT_TRIAGE_OPEN_PULL_REQUEST |
Off | No change to the alerts. On, the agent opens the recommended fix as a pull request without a reply from a person. | On, each triage turn adds one Platform Agent run, which opens the fix. |
platformAgent.deployment.incidentMaxOpenPullRequests |
0, no limit |
Limits how many of those pull requests are open at once. | A triage turn over the limit still runs. Only its pull request run is held back. |
The ceiling is silent: no message says that a bucket is spent. Read /v1/alert-quota each day
while you tune, as
Reading what the ceiling held back
describes.
Settings that decide what one triage turn costs
Section titled “Settings that decide what one triage turn costs”One model serves chat, event triage and the scheduled checks. No setting selects a model for triage alone, so each setting in this table changes every answer of the install.
| Setting | Default | Effect on token cost |
|---|---|---|
litellm.modelProvider and litellm.modelDefaultName |
gemini and that provider’s default model |
The price of each token. A lower-cost model lowers the cost of each triage turn and of each chat answer together. |
litellm.reasoningEffort |
Empty: the model’s own level | A lower level asks the model for less reasoning on each call. Measure the saving on your install. |
litellm.budget |
usd: 0, off |
A loose upper limit on what the inference gateway spends in each period. When the limit is spent, the gateway refuses every model call until the period ends, chat included. It bounds a runaway only. |
Do not lower spec.harness.tuning.cluster.maxTurns
to save tokens. A Cluster Agent run that reaches the limit posts no report, and the card runs again.
A low-cost starter configuration
Section titled “A low-cost starter configuration”The values below keep a new multi-cluster install inside a small number of event triage turns a day. They leave out the clusters and namespaces whose failures nobody acts on, and they lower the daily ceiling for the fleet. The ceilings of five Critical and three Warning alerts are examples, not sized values. Replace them, and the cluster and namespace names, with your own.
platformAgent: harness: eventWatcher: alertExclude: # A cluster whose failures need no alert. The agent can still read it. - cluster: { clusterName: dev-cluster } # A namespace whose failures need no alert, on every cluster. - namespace: load-test deployment: # The most event alerts, and thus triages, in one UTC day for all clusters. alertDailyLimits: critical: 5 warning: 3Apply it as a values file with helm upgrade. If the install’s CRDs are older than the chart, apply
the chart’s CRDs first, as
the spec.harness.eventWatcher reference
describes. An install made with install.sh has no values file. Set the two ceilings there with
ALERT_DAILY_LIMIT_CRITICAL=5 and ALERT_DAILY_LIMIT_WARNING=3 in install.env, put the rules on
its TF_VAR_extra_helm_values line, and run upgrade.sh --upgrade-mode=full. install.env holds
one such line, so add the keys to a line that exists
(Operator settings):
TF_VAR_extra_helm_values='{platformAgent={harness={eventWatcher={alertExclude=[{cluster={clusterName="dev-cluster"}},{namespace="load-test"}]}}}}'A change to a ceiling restarts the agent pod and the credential-proxy pod. The first apply that sets
a ceiling also replaces the entries that you added by hand to the PlatformAgent’s
spec.deployment.env. Daily alert ceiling
says how to keep them.
The two ceilings count cluster-event alerts only. Drift alerts spend a bucket of their own, and the alerts of the stall watch spend none.
The starter leaves four things at their defaults:
- The provider’s default model.
- The one-hour fold of a workload’s events into one incident.
- The counts and times that hold back a failure that clears by itself.
- The pull request switch, which stays off.
A lower ceiling has a price. An alert over the ceiling is lost from chat for that day, and a workload that still fails alerts on the next day. After a week, size each bucket from your own counts, as Sizing a bucket describes, and remove an alert-exclude rule when its cluster or namespace is ready for alerts.
Measure before and after
Section titled “Measure before and after”Three places show what a change did:
- The watcher’s counters for each cluster:
k8s_event_watcher_events_filtered_totalandk8s_event_watcher_events_deduped_totalfor the events that the watcher held back, andk8s_event_watcher_triage_sessions_totalfor the triage turns that started (Observability). - The
PlatformAgent’sstatus.usage, which the operator refreshes every five minutes (Observability).sessionsTotallesschatSessionsTotalis the number of triage sessions. It can read low after a re-seed of the counters from a status that has nochatSessionsTotal.inputTokensTotal,outputTokensTotalandspendMicrosUSDTotalcover every model call of the install, chat included. - The inference gateway’s
litellm_spend_metric_total(Where token spend lives).
Compare the triage sessions and the spend of a week before the change with a week after it.