domino_admin_toolkit.analyzers.prometheus_health module
Analyzers for the Prometheus self-health check (checks/test_prometheus_health.py).
Every signal here comes from Kubernetes object status and the kubelet Summary API, never from PromQL: the check has to keep working in the outage it reports. Thresholds come from the failure modes in the Prometheus runbook:
Prometheus deliberately runs without a memory limit (“Because Prometheus is a database, we generally don’t constrain the memory with a hard-cap”), so its memory risk is pushing its node into evicting Domino services, not hitting a limit. Headroom is judged against the limit when one is set and against the node otherwise.
Loading data from disk at startup uses more memory than steady state and shows up as probe failures, sometimes without an OOM kill — so a recent non-OOM restart is worth a WARN.
TSDB retention is 15GB on a 20Gi volume (~70% full at steady state); well beyond that, retention is not keeping up and the volume is heading for out-of-disk.
prometheus-adapter was OOM-killed on large 5.x clusters (fixed in 5.5.0) and is absent on current releases, so its absence is not an error.
- pydantic model domino_admin_toolkit.analyzers.prometheus_health.PrometheusMemoryHeadroom
Bases:
AnalyzerBase[PrometheusHealthRow]Memory headroom, against the container limit when one is set and against the node otherwise.
Prometheus runs without a limit by design, so on a default install the risk is the node: an unconstrained Prometheus pushes its platform node toward memory pressure, and the kubelet then evicts Domino services. prometheus-adapter has a limit, so it is judged like
K8sPodMemoryLimitHeadroomjudges any other container.FAIL: working set at or above
limit_threshold_pctof the limit.FAIL (no limit): working set at or above
node_share_threshold_pctof node allocatable, or the node’s available memory belownode_available_min_pctof allocatable.ERROR: the container is running but its memory could not be read.
PASS: otherwise. Rows without a running container are left to the readiness analyzer.
-
field limit_threshold_pct:
float= 90.0 Working set as a percentage of the container memory limit at which an OOM kill is likely
-
field node_available_min_pct:
float= 10.0 Without a limit: node available memory, as a percentage of allocatable, below which eviction looms
Without a limit: working set as a percentage of node allocatable memory
- analyze(data)
Analyzes one row and returns a list of CheckResult instances.
- Return type:
- Args:
data: One row dict (
TRow). The Runner calls this once per DataFrame row.- Returns:
List[CheckResult]: A list containing the results of the analysis.
- Raises:
NotImplementedError: If this method is not implemented by subclasses.
- name: ClassVar[str] = 'PrometheusMemoryHeadroom'
- pydantic model domino_admin_toolkit.analyzers.prometheus_health.PrometheusPodReadiness
Bases:
AnalyzerBase[PrometheusHealthRow]Is the Prometheus server (or the adapter) up and Ready?
FAIL: no pods, evicted, or not Ready — the outage the rest of the report suffers from.
WARN: not Ready yet, but started within
startup_grace_minuteswithout a recent restart. Prometheus replays its write-ahead log on startup and is legitimately unready meanwhile. A pod whose container has not started yet (ContainerCreating, PodInitializing) is measured from pod creation; one that crashed on its first start gets no grace.WARN: Ready, but evicted pods remain from a recent eviction.
ERROR: the workload itself was not found, so health cannot be judged.
PASS: Ready, or the adapter is not deployed (it is absent on current Domino releases).
- Fields:
-
field startup_grace_minutes:
float= 10.0 Minutes a freshly started, never-restarted pod may stay unready before it FAILs
- analyze(data)
Analyzes one row and returns a list of CheckResult instances.
- Return type:
- Args:
data: One row dict (
TRow). The Runner calls this once per DataFrame row.- Returns:
List[CheckResult]: A list containing the results of the analysis.
- Raises:
NotImplementedError: If this method is not implemented by subclasses.
- name: ClassVar[str] = 'PrometheusPodReadiness'
- pydantic model domino_admin_toolkit.analyzers.prometheus_health.PrometheusRecentRestart
Bases:
AnalyzerBase[PrometheusHealthRow]Did the container restart recently, and was it an OOM kill?
Reads
lastState.terminatedfrom the pod status, which carries the reason and the exact finish time — so unlike the sticky kube-state-metrics gauge inpod_memory.py, an old kill can be told apart from an active one.FAIL: last termination was
OOMKilledwithinrestart_window_hours, or at an unknown time.WARN: restarted within the window for another reason. A liveness-probe kill while loading data from disk is a known Prometheus failure mode that does not show as OOMKilled.
PASS: no previous termination, or it is older than the window.
- Fields:
- analyze(data)
Analyzes one row and returns a list of CheckResult instances.
- Return type:
- Args:
data: One row dict (
TRow). The Runner calls this once per DataFrame row.- Returns:
List[CheckResult]: A list containing the results of the analysis.
- Raises:
NotImplementedError: If this method is not implemented by subclasses.
- name: ClassVar[str] = 'PrometheusRecentRestart'
- pydantic model domino_admin_toolkit.analyzers.prometheus_health.PrometheusTsdbDisk
Bases:
AnalyzerBase[PrometheusHealthRow]TSDB volume usage against capacity, for the Prometheus server.
With the default 15GB retention.size on a 20Gi volume, a healthy server sits near 70%. Well beyond that, retention is not keeping up; a full volume stops ingestion.
FAIL: usage at or above
used_threshold_pctof capacity.ERROR: the server is running but its volume stats could not be read.
PASS: otherwise. Adapter rows and rows without a running server are skipped.
- Fields:
- analyze(data)
Analyzes one row and returns a list of CheckResult instances.
- Return type:
- Args:
data: One row dict (
TRow). The Runner calls this once per DataFrame row.- Returns:
List[CheckResult]: A list containing the results of the analysis.
- Raises:
NotImplementedError: If this method is not implemented by subclasses.
- name: ClassVar[str] = 'PrometheusTsdbDisk'