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.

class domino_admin_toolkit.analyzers.prometheus_health.PrometheusHealthRow

Bases: TypedDict

component: str
evicted_pods: float | None
last_terminated_minutes_ago: float | None
last_termination_exit_code: float | None
last_termination_reason: str | None
mem_limit: float | None
mem_used: float | None
node: str | None
node_allocatable: float | None
node_available: float | None
note: str | None
pod: str
ready: bool | None
restarts: float | None
retention_size: str | None
started_minutes_ago: float | None
state: str
tsdb_capacity: float | None
tsdb_pvc: str | None
tsdb_used: float | None
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 K8sPodMemoryLimitHeadroom judges any other container.

  • FAIL: working set at or above limit_threshold_pct of the limit.

  • FAIL (no limit): working set at or above node_share_threshold_pct of node allocatable, or the node’s available memory below node_available_min_pct of 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.

Fields:
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

field node_share_threshold_pct: float = 25.0

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:

list[CheckResult]

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_minutes without 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:

list[CheckResult]

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.terminated from the pod status, which carries the reason and the exact finish time — so unlike the sticky kube-state-metrics gauge in pod_memory.py, an old kill can be told apart from an active one.

  • FAIL: last termination was OOMKilled within restart_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:
field restart_window_hours: float = 24.0

A termination within this many hours counts as recent

analyze(data)

Analyzes one row and returns a list of CheckResult instances.

Return type:

list[CheckResult]

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_pct of 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:
field used_threshold_pct: float = 85.0

TSDB volume usage as a percentage of capacity

analyze(data)

Analyzes one row and returns a list of CheckResult instances.

Return type:

list[CheckResult]

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'
domino_admin_toolkit.analyzers.prometheus_health.format_minutes(minutes)

Compact age: “42m”, “5.2h”, “3.1d”.

Return type:

str