Metrics reference¶
All three components serve Prometheus metrics on their metrics endpoint (:8443 over HTTPS with config/default; who may scrape it and how is in the configuration reference). By default the endpoint's certificate is self-signed and the chart's ServiceMonitor skips its verification; the optional TLS trust profile lets Prometheus verify it against a CA and a server name. Next to controller-runtime's own metrics (below), Shadewright adds the metrics on this page, all named shadewright_* and registered on controller-runtime's registry.
Every label takes its values from a closed set listed here, never from a name, namespace, UID, fingerprint or message in the cluster, so the number of series stays fixed whatever the cluster holds. A value a component does not know (a phase written by a newer version, a reason outside the list) is reported as Other. Tests in internal/controller/metrics_test.go and internal/incidents/metrics_test.go check, with internal/testutil/metricguard, that every shadewright_* metric the package registers is in the test's table, has only the labels the table names and only label values from the table's sets (after free text has been passed through the phase and reason paths), and that every metric in the table is named on this page. internal/controller/denialreasons_test.go fails when a reason constant of the policy check or the source mapping is missing from the denial reasons reported by name.
The phase gauges are computed when the endpoint is scraped, from the informer the leader's controller already uses, and only once that informer has synced: a scrape makes no API call and never starts a watch. Only the leader reports them; a standby replica, or a leader whose informer has not synced yet, reports no series for them. Counters are reported by the replica that did the work (the leader) and start again at zero when a Pod restarts: use rate or increase. Counters with a closed set of labels report every value from the start, at zero. Aggregating with max across replicas is safe for every gauge here.
Executor¶
| Metric | Type | Labels | Meaning |
|---|---|---|---|
shadewright_remediation_requests |
gauge | phase: a RemediationRequest phase, None (no phase yet) or Other |
RemediationRequests in the operator namespace, by phase. Reported by the leader only; missing (not zero) before its informer has synced or when the read fails |
shadewright_policy_decisions_total |
counter | outcome: allowed, denied, needs_intervention |
Decisions of the policy check, each counted at most once, after the write of the status that records it succeeded. A write that lands but whose answer is lost is not counted, and the next reconcile finds the request decided, so the counter undercounts while the API server has errors |
shadewright_policy_denials_total |
counter | reason: the PolicyAllowed reason of a Denied request, or Other |
Requests the policy check denied, by reason. The reasons are those of the policy check (PolicyNotFound, SettingsNotFound, TargetMismatch, PreviousValueMismatch), of the policy rules (for example AboveMaximum, KindNotAllowed, ModuleNotEnabled) and of the source mapping (for example RepositoryNotInPolicy, BranchMismatch). Every reason in the list and Other start at zero |
shadewright_remediation_reconcile_errors_total |
counter | kind: timeout, conflict, cancelled, other |
Errors the RemediationRequest reconciler returned, each retried with backoff. timeout is a step that reached its own deadline, conflict a status write made from a stale read (harmless when it is rare), cancelled a reconcile stopped by shutdown or a lost leadership. controller-runtime's controller_runtime_reconcile_errors_total{controller="remediationrequest"} counts the same errors without a kind |
shadewright_remediations_in_flight |
gauge | none | RemediationRequests that hold a slot under maxConcurrentRemediations, as the last check of the limits counted them. 0 until the first check |
shadewright_remediation_concurrency_limit |
gauge | none | maxConcurrentRemediations in force at the last check of the limits. 0 until the first check |
shadewright_remediation_waits_total |
counter | reason: target_locked, concurrency_limit, circuit_open, circuit_half_open, limits_unknown |
Times a request that passed every check was held back Queued before the decision, by reason; a request is counted again at each recheck while it waits (30 s, or 10 min behind a lock held by a stopped request). limits_unknown is a check of the limits that failed and is retried with backoff (fail closed) |
shadewright_circuit_breaker_open |
gauge | none | 1 while the circuit breaker of design 10, item 7 is open or half-open (it closes only on a success), 0 while it is closed, as the last check of the limits found it. The gauge does not tell open from half-open: shadewright_remediation_waits_total{reason="circuit_half_open"} rises only while requests wait behind a running probe, so a half-open breaker that no request has tried yet looks like an open one |
shadewright_circuit_breaker_trips_total |
counter | none | Times this process found the breaker open after it had found it closed or half-open (or at its first check), so a probe that did not succeed is a trip. Starts again at zero when the Pod restarts |
shadewright_circuit_breaker_clear_errors_total |
counter | none | Reads or writes of the breaker's watermark (design 10.7: status.breakerCounts set to false on outcomes the breaker no longer needs, and set back to true by the finalizer of a deleted success) that failed in a way that does not go away by itself, such as Forbidden or Invalid (the executor's role or the CRD does not match the release). Nothing is let through by it: a failed clearing leaves the outcomes read, so the breaker's reads grow again with the history; a failed restore keeps the finalizer, so the request stays Terminating and is tried again every 5 minutes. Transient failures are only logged. Any rise needs a look at the executor's log and RBAC |
Analyzer¶
| Metric | Type | Labels | Meaning |
|---|---|---|---|
shadewright_analyzer_watched_namespaces |
gauge | none | Namespaces the analyzer watches (--watch-namespaces), set once at start on every replica. 0 is valid (the chart's default) and means it reads no events or pods and records no Incident: alert on it if you expect Incidents |
shadewright_analyzer_symptom_source_watched |
gauge | group, kind: a kind of an add-on that a module reads symptoms from (KEDA ScaledObject and ScaledJob, Flux Kustomization, HelmRelease and GitRepository, Kyverno Policy, ClusterPolicy, PolicyReport and ClusterPolicyReport) |
1 when the kind is watched and its cache has synced, 0 when an active module reads it but the analyzer does not watch it: the API server does not serve it, or the analyzer may not list it (the module's value under analyzer.modules in the chart is off), or the check or the watch failed (a failed watch is started again after a backoff of up to 30 minutes). No series for a kind no active module reads, and none for a kind whose optional grant the chart leaves out on purpose: the Kyverno ClusterPolicy and ClusterPolicyReport with analyzer.modules.kyverno.clusterWide.enabled off, the least-privilege setup, so an alert on 0 stays quiet on such an install. Checked every 30 seconds by the leader while the kind is not watched; the condition SymptomSourcesNotWatched of the RemediationSettings status says why. Alert on 0 |
shadewright_analyzer_subject_owner_forbidden_total |
counter | group, kind: the owner kind a module's symptom source declares as the subject (KEDA ScaledObject, the owner of a KEDA HPA) |
Reads of a symptom's declared owner that the API server refused (Forbidden), each leaving the watched object itself as the Incident's subject (the HPA instead of its ScaledObject) and logged as Not allowed to read the declared owner. A rise means the module's grant is missing (analyzer.modules.keda.enabled off while the KEDA module is enabled), and the Incidents of those symptoms are about the HPA |
shadewright_analyzer_replaced_template_evidence_dropped_total |
counter | kind: Deployment or StatefulSet, the workload of the pod |
Pod evidence (a container termination, an event about the pod, a Pod symptom state) that became no observation because its workload has retired the pod's template: its ReplicaSet is scaled to 0 with a revision lower than the Deployment's (or is gone while the pod terminates), or the pod terminates with a revision other than the StatefulSet's update revision (design 3.1, #724). Counted once per termination, event or symptom state: a dropped one is recorded as handled. A termination other than OOMKilled of a pod being deleted is no evidence at all (#966) and is not counted here. A rise during rollouts is expected. Each drop also logs Dropped evidence of a pod whose template its workload has retired at debug level |
shadewright_analyzer_replaced_template_check_errors_total |
counter | kind: Deployment or StatefulSet, the workload of the pod |
Pod evidence kept because a read that decides whether its template was retired failed (a timeout, throttling, a refused read), as above. The check fails open, so the evidence reaches an Incident as it would without it. A steady rise means the filter is in effect off; the debug log Kept pod evidence, the state of its workload could not be read names the error |
shadewright_analyzer_settled_probe_failures_skipped_total |
counter | probe: Readiness or Startup |
Unhealthy events of the kubelet about a failed readiness or startup probe that became no observation (design 3.1, #726): the failure was part of the pod's start (no restart, within 5 minutes of the probed container's start, and the pod became Ready after it, at once or after waiting up to 1 minute from the failure for a pod not Ready yet), or came at or after the pod's deletion. Counted once per event: a skipped one is recorded as handled. A rise when pods start or are deleted (rollouts, scale-ups, scale-downs) is expected. Each skip also logs Skipped probe failure of a Pod that became Ready at start with no restarts or Skipped probe failure of a terminating Pod at debug level |
shadewright_analyzer_probe_decisions_pending |
gauge | none | Readiness or startup probe failures the collector holds in memory: those waiting for a starting pod to become Ready, and those decided to count whose observation is not delivered yet. At most 10,000 (the event state's bound); at the bound a new failure counts at once. It falls back to 0 as decisions are made, so a level that stays high means events that are neither decided nor deleted |
shadewright_analyzer_held_consequences_total |
counter | outcome: opened, not_opened, released, cause_unseen, dropped or overflow |
Ends of the collector's hold of a consequence (a kubelet BackOff or Unhealthy event on a named container) whose pod status shows no cause (ADR-0039 point 19, #792), or shows a cause the Incident controller has not seen yet (point 7, #828): opened when no cause was shown, the container was seen failing at least twice and was still failing at the end of the 2 minute hold or restarted at least twice during it, so the observation went to the gate; not_opened when it recovered (with no cause shown, or with a cause the Incident controller had not seen by the end of the 2 minutes: at least two failing samples and the last one failing, or two restarts, are needed to go on), or when no cause was shown and its pod was gone or replaced, so nothing opened; released when the Incident controller saw, during the hold, a cause the consequence would be counted on (the cause's Incident of the same workload, not Resolved more than 24 hours before; a cause the controller holds only as a first sighting is not enough) and the observation went on with it at once; cause_unseen when the hold had a cause the controller had not seen when it ended, at the end of the 2 minutes with the container still failing, or when the pod went, was replaced or its template retired, and the observation went on with that cause; dropped when the event itself ended the hold (deleted, no longer a Warning, replaced by another event of the same name, or handled without an observation for another reason, such as a settled probe failure or a retired template; for a hold with a cause only an event that no longer exists). These five add up to the holds started; a consequence whose cause the controller had seen at its first sight is not held and counts none. A steady share of cause_unseen means causes whose Incident opens later than the hold (a cause that opens only when seen again, after 2 minutes), or not at all (refused at the Incident cap, or whose Incident was Resolved more than 24 hours ago and has not come back); the first sightings of the Incident controller still count those consequences on the cause's Incident when it opens, and the late-cause fold closes a consequence Incident opened meanwhile if the cause's Incident opens within 15 minutes; until #849 is closed, a cause_unseen consequence of a cause the gate holds can open an Incident of its own and be analyzed. overflow counts consequences never held: there was no room (1,024 and 256 per namespace for the holds first seen with a cause, and the same for those with none, so 2,048 in all) and it went to the gate at once, unheld, with the cause its pod showed if any, never dropped, counted once even when its delivery is retried. Each not_opened, cause_unseen and overflow also logs at debug level |
shadewright_analyzer_consequences_held |
gauge | none | Consequences the collector holds now: with no cause, waiting for the end of their 2 minute hold, or with a cause the Incident controller has not seen yet, waiting for it at most as long; and those decided to emit and not delivered yet. At most 1,024, and 256 per namespace, for the holds first seen with a cause and for those with none apart, so at most 2,048 in all; a level that stays at a bound means new consequences of that share go to the gate unheld |
shadewright_analyzer_stale_on_start_folded_total |
counter | none | Event observations the collector handed to the Incident controller as fold only after a start (ADR-0039, amendment of 2026-11-21, #996): a Warning event of the informer's initial list (a restart, or a new leader), unchanged since, about a Pod that is gone, whose last occurrence is more than 5 minutes (collector.StaleOnStart) before the collector started. Counted once handed over: a delivery retry, a hold that drops the event or an answer of the Incident controller that leaves nothing new sends nothing and is not counted. Such an observation is counted only on an Incident that exists and opens none; with none it is dropped, counted in shadewright_incident_batches_dropped_total (reason stale_on_start) and logged (Dropped an observation of an event from before the start about a pod that is gone). An event last seen within the 5 minutes, or with no time of its own, is not counted here and is handled as any other |
shadewright_analyzer_context_log_reads_without_lines_total |
counter | reason: collected, pod_not_found, rejected, forbidden, failed, oversized, empty, withheld |
Log reads of the context builder that gave no lines, by reason: collected the node no longer holds the log of that container instance (the kubelet keeps one terminated instance per container), pod_not_found the pod is gone, rejected the API server refused the request (no such container, not started, no previous instance), forbidden the analyzer may not read the pod's logs, failed the read failed (a timeout, a server error), oversized the source answered more than asked, empty it answered with no lines, withheld redaction withheld the read whole (#873). Each also logs Read no log lines of a container instance for the incident context with the container, the instance and the reason. Every reason starts at zero. A rise of forbidden means the analyzer's pods/log grant is missing in a watched namespace; a steady rise of failed needs a look at the API server |
shadewright_incidents |
gauge | phase: an Incident phase, None or Other |
Incidents in the operator namespace, by phase. Reported by the leader only; missing (not zero) before its informer has synced or when the read fails |
shadewright_incidents_analysis_due |
gauge | none | Incidents whose AnalysisDue condition is True. Reported with the gauge above |
shadewright_incident_cap |
gauge | none | The cap on Incidents (--max-incidents, 500 by default), set by each pass of the analysis trigger (every 10 s) on the leader from its memory, also when the pass cannot list the Incidents; 0 before the first pass and on a standby replica, so aggregate with max |
shadewright_incident_cap_near |
gauge | none | 1 while the Incidents that exist or are being created reached 80% of the cap (400 of 500) at the last trigger pass, else 0. Crossing it also writes a Warning event IncidentCapNear about the analyzer's Pod, once per crossing and at most once per 10 minutes. Alert on max(shadewright_incident_cap_near) == 1, or on sum(shadewright_incidents) >= 0.8 * max(shadewright_incident_cap), and clear Resolved Incidents before new fingerprints are refused |
shadewright_analyses_used_today |
gauge | none | Analyses counted against the current UTC day in the budget ConfigMap, as the last pass of the analysis trigger read it. Missing while the budget is unknown: before the first pass, and after a pass that could not read the settings or could not read or trust the ConfigMap (the trigger then marks nothing due). On a replica that lost leadership it keeps the value of its last pass |
shadewright_analyses_per_day_limit |
gauge | none | The daily limit of the RemediationSettings (spec.analysis.maxAnalysesPerDay, or the deprecated spec.maxAnalysesPerDay when set and lower), set by every pass that read the settings and found a limit, even when the ConfigMap then fails. Missing while the settings are unknown |
shadewright_redaction_heap_waits_total |
counter | none | Redactions that waited for others to finish before running (#1087, design 10.3): every redaction but the collector's (event notes of at most 4 KiB, which never wait) takes a weight of 4 MiB plus 100 bytes per byte of its text from a limit of half the Go memory limit (GOMEMLIMIT; 64 MiB when none is set), and waits when the redactions running hold too much of it; a text over about 1.1 MiB with the analyzer's default runs alone. A wait that ends before the redaction can run withholds it (shadewright_redaction_withheld_total, reason wait). Served by the executor and the analyzer. A steady rise means analyses running side by side on large texts: they take longer, and one whose deadline passes while it waits escalates |
shadewright_redaction_withheld_total |
counter | reason: work, size, heap, wait |
Entries redaction withheld whole (#873, design 10.3): work when the steps of one decision ran out of its budget (1,024 per byte of the entry plus 65,536), size when the entry was longer than 4 MiB, or a read tool's answer or a section of the context build longer than 1.5 MiB (the largest entry the heap was measured for, #1106), and nothing was read, heap when it held more pieces (a tool's answer) or strings than its bytes allow (one piece for every 2 bytes, one string for every 16, past the first 4,096) and nothing was read, so that one redaction holds at most 28 bytes of heap per byte of its entry plus 4 MiB on the shapes the heap tests list as within that bound (text dense in matches or in control characters holds more, at worst 71.7 bytes per byte measured), and wait when its wait for the limit on the heap of redactions at once ended (the caller's deadline, or 2 minutes) and nothing was read. The caller got [REDACTED:withheld] and showed it as a source that failed (a tool's "could not fetch", labelled withheld by redaction); a reviewer hint withheld is refused as NotRedactable, an analysis record whose check is withheld for its work or size is refused by the store (shadewright_analysis_records_total, refused), and one whose check waited on every try of the write is not written (failed). Served by the executor and the analyzer, each of which redacts (the verifier does not); all four series start at zero. Any rise of work is worth a look: no shape of the test corpora is known to pass the budget since #962 brought the last four that did under the budget (glued quoted pairs, TOKEN="a" before a long blank line, and --token,} and -password, repeated), and every shape of the corpora grows linearly (TestCorpusWorkGrowsLinearly), so a rise can be a new shape (troubleshooting) |
shadewright_analysis_records_total |
counter | result: written, exists, failed, skipped, refused |
Analysis record writes when a record store is configured (--analysis-store-account, ADR-0015). The series exist only then: no series means no store, zeros mean nothing written yet. written and exists (the record's ID, which is unique per run, was there already: an earlier try of the same write stored it) put the ID into status.analysisRecords, unless the run's claim is lost before its outcome write (the analyzer then logs the record's ID with "Dropped the outcome"). skipped (no time left on the claim before the outcome write, or the claim was lost) and refused (the store refused the record, for example data the redactor still changes, or whose check by the redactor is withheld for its work or size) store nothing. failed (the write or the live read of the claim before it failed, or the redactor's check of the record did not run on any try of the write because each wait for the heap limit of redactions at once ended; its event says so) puts no ID into the status, but when the write's last try got no answer the record may be stored all the same. All three also write a Warning event AnalysisRecordNotWritten on the Incident. Alert on a rise of anything but written |
shadewright_analysis_reservations_total |
counter | result: reserved, budget_spent, budget_not_found, budget_unreadable, error |
Attempts to take a unit of the daily analysis budget before a model call. Only reserved lets the model be called. error covers every other refusal, settings without spec.analysis.maxAnalysesPerDay included. The analysis loop reserves units when the analyzer runs with --triage-model; without it nothing reserves any |
shadewright_analysis_skipped_not_recent_total |
counter | none | Incidents never analyzed whose first analysis was skipped (AnalysisDue reason NotRecent) because they were not seen within the recent window (by default the cooldown, 15 min), counted with a Normal event AnalysisSkipped on the Incident once each time the condition changes to NotRecent (exactly once per NotRecent one analyzer process wrote that still stands when it next reads or writes the condition, also when the write's answer was lost: a later pass reports it; a NotRecent that landed unreported and is written over by a mark that says due is not counted, since the Incident is analyzed after all; a NotRecent written before the analyzer's leader started is not counted again, and one the old leader writes during a leader handover can be counted by both leaders), so a second quiet spell before the Incident is next marked due is not counted again (design 3.2). A rise after settings are applied or the budget resets means old one-off symptoms were left alone |
shadewright_analysis_trigger_errors_total |
counter | none | Passes of the analysis trigger that failed (an unreadable settings object or budget, a failed write of AnalysisDue, a failed late-cause fold, ADR-0039); each is retried at the next interval |
shadewright_incident_first_sightings_held |
gauge | none | Symptoms seen once, with no Incident yet, held in memory until they are seen again 2 to 15 minutes later (design 3.2). At most 4,096; forgotten after 15 minutes and on a restart. Only the leader holds any (0 on other replicas). A value that stays high means many one-off Warnings, which open no Incident |
shadewright_incident_write_errors_total |
counter | none | Writes of an Incident's status that failed and are retried, the late-cause fold of the write loop included (ADR-0039); a fold cancelled by shutdown is not counted |
shadewright_incident_batches_dropped_total |
counter | reason: invalid, fingerprint_conflict, stopped, deleted, stale_on_start |
Batches of observations not stored: refused by the API server as invalid, an Incident of the expected name holds another fingerprint, still unwritten when the process stopped, or meant for an Incident deleted while the analyzer ran (any occurrence, the first included since #893), which it does not create again: found at a write, dropped at once when the Incident informer reports the delete, or carried by a write in flight at that moment. stale_on_start counts one per observation: an event from before the analyzer started about a pod that is gone, last seen more than 5 minutes before the start, with no Incident to fold into (#996); after an outage of the analyzer longer than 5 minutes it includes events of pods deleted during the outage |
shadewright_incident_observations_refused_total |
counter | none | Observations of a new fingerprint, or of the next occurrence of a Resolved Incident, not stored because the cap on Incidents (--max-incidents) was reached |
shadewright_incident_occurrences_overflow_total |
counter | none | Observations of a new occurrence not counted because the caps on occurrences held unwritten (per Incident, per namespace share, total) were reached |
controller-runtime metrics¶
controller-runtime adds, among others, controller_runtime_reconcile_total, controller_runtime_reconcile_errors_total, controller_runtime_reconcile_time_seconds, workqueue_* (labelled by controller name), rest_client_requests_total and leader_election_master_status, plus the Go and process collectors. See the controller-runtime metrics reference.
Useful queries¶
# Requests waiting for a person
sum(shadewright_remediation_requests{phase=~"NeedsIntervention|AwaitingApproval"})
# Denials by reason over the last day
sum by (reason) (increase(shadewright_policy_denials_total[1d]))
# An analyzer that watches no namespace, so it records no Incident
max(shadewright_analyzer_watched_namespaces) == 0
# Share of today's analysis budget used
max(shadewright_analyses_used_today) / max(shadewright_analyses_per_day_limit)