Recommended Evaluation Duration
To filter out transient state transitions during scheduled updates or re-provisioning, the recommended evaluation window for talos_node_health is 5 to 10 minutes. This duration typically covers the window where a node transitions from a desired state to an actual state during a reboot or configuration apply, preventing false positives during legitimate rolling updates.
Distinguishing Drift from Telemetry Gaps
The critical difference between state drift and a telemetry gap is the presence of the metric itself. State drift is a value-based discrepancy, while a telemetry gap is a presence-based failure.
1. Identifying Genuine State Drift
State drift occurs when the Prometheus target is reachable, but the talos_node_health metric reports a value indicating a mismatch between the desired and actual state. This is a logical failure of the state machine.
2. Identifying Telemetry Gaps
Telemetry gaps, often caused by resource exhaustion or CPU spikes, result in scrape timeouts. In these cases, the metric is missing entirely from the current scrape interval. If you alert only on the value of talos_node_health, a missing metric may be interpreted as a "stale" value or a gap, depending on your query logic.
Implementation Strategy
Use a combination of the absent() function and a for duration in your Prometheus alerting rules to separate these two failure modes:
- For State Drift: Alert when the health metric value indicates a mismatch, but only after it has persisted beyond the transient window.
- For Telemetry Gaps: Alert when the target is unreachable or the metric is absent, using a shorter window if the node is critical, or a longer window to account for high-pressure resource spikes.
# Example: Alert on persistent state drift
- alert: TalosNodeStateDrift
expr: talos_node_health != 1
for: 10m
labels:
severity: warning
annotations:
summary: "Node state drift detected on {{ $labels.instance }}"
# Example: Alert on telemetry gap (Resource Exhaustion)
- alert: TalosTelemetryGap
expr: absent(talos_node_health)
for: 5m
labels:
severity: critical
annotations:
summary: "Telemetry gap: Node {{ $labels.instance }} is not reporting health metrics"
Assumptions and Verification
This approach assumes you are using a standard Prometheus/Alertmanager stack. To verify this configuration, simulate a node update and observe the talos_node_health metric in the Prometheus expression browser to ensure the for duration exceeds the typical transition time of your specific hardware/cloud environment.
Missing Diagnostic Detail: Are you utilizing a specific Talos version or a custom scrape interval (e.g., shorter than 15s)? A very aggressive scrape interval may require a tighter absent() window to distinguish between a single dropped packet and a genuine resource-induced hang.