liveBook · Manning

Absent function

As explained in Machine Learning Platform Engineering

The absent function is a PromQL function that returns a value indicating whether a specified metric is absent from queried data.

The PromQL absent function detects when a specified metric disappears from queried data. It returns 1 when the metric is absent and 0 when it is present, covering failures where a deployment is deleted or terminated and the up metric no longer exists. section 11.1.4

Detecting a missing BentoML deployment metric

Use absent(up{job="yatai/bento-deployment", yatai_ai_bento_deployment_component_type=~"api-server|runner"}) == 1 to trigger a MissingUpMetric alert. Pair the expression with a five-minute duration and critical severity so brief metric gaps do not immediately page operators.

How Machine Learning Platform Engineering covers it

How deep it goes
Explains return values and embeds the function in a complete Prometheus alert rule, but does not detail function internals.
Examples
Uses the up metric, a MissingUpMetric rule, BentoML deployment termination, and Prometheus alert-state transitions.
What it assumes
Assumes familiarity with Prometheus metrics and alert rules while demonstrating the absent expression in a deployment-monitoring workflow.
What you can do after
Operate/configure Prometheus alerts that distinguish a down target from a completely missing deployment metric.
How it connects
Connects PromQL, Prometheus metrics, alerting rules, Alertmanager, Helm, and BentoML deployment monitoring.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.