rollfuse
← Back to blog

Automatic Rollback Based on a Prometheus Metric

Prometheus is where most teams' rollout-relevant metrics already live: request rate, error rate, latency histograms, all queryable via PromQL. What Prometheus doesn't do on its own is turn a bad query result into an action. Alertmanager can page someone. Nothing in the Prometheus stack itself reverts a deployment.

To get from "PromQL result crossed a threshold" to "traffic reverted, automatically, no one paged," you need three things: the metric evaluated regularly, a threshold with a real evaluation window, and something on the other end that actually changes the deployment's traffic split. Prometheus is good at exactly one of those three.

Where rollfuse fits, and where it doesn't (yet)

To be direct about this: rollfuse doesn't scrape Prometheus or run PromQL. There's no "connect your Prometheus" button. What rollfuse's guardrails do is evaluate a MetricDefinition, a value with an aggregation type, on a schedule, and abort a rollout automatically when it crosses a threshold. The gap between "Prometheus has the data" and "rollfuse can act on it" is a bridge you build, not a feature you toggle.

Two ways to build that bridge today:

Push the derived value. Run your PromQL query on whatever schedule matches your evaluation window (a cron job, a sidecar, a recording rule polled by a small script), and push the result to rollfuse's observation endpoint for that metric:

POST /v1/environments/{environment_id}/metric-definitions/{metric_definition_id}/observations
{
  "value": 0.014,
  "observed_at": "2026-08-21T14:32:00Z"
}

The guardrail attached to that metric definition evaluates exactly the same way it would for any other pushed value: same threshold, same evaluation window, same automatic-abort behavior.

Pull via a Connector. rollfuse's Connector system maps an external source's JSON response to {value, observed_at} on a schedule, via a reusable contract template. Prometheus's own HTTP query API returns JSON, so a template that maps its response shape lets a Connector poll it directly, without you writing and hosting the polling script yourself.

Why the bridge is worth building instead of skipping

The alternative: Alertmanager pages a human, the human looks at Grafana, the human runs the rollback command. It works, but it's minutes, not seconds, and it only works when someone's actually watching the pager at 3 a.m. The gap between "Prometheus knows" and "the rollout reverted" is exactly the gap that turns a contained regression into an incident report. Closing it doesn't require replacing Prometheus. It requires one more consumer of the query result you're already computing.