DEVOPS

Cloudflare Cache Hit-Ratio Regression Sentinel with Auto-Rollback MR

Watches Cloudflare cache hit ratio on a schedule, and when a recent config change tanks efficiency it correlates the drop to the offending commit and opens a GitLab rollback…

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerschedule
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerEvery 15 minutes
  • ActionPull cache hit ratio vs baseline (Cloudflare GraphQL)CloudflareCloudflare
  • LogicDrop exceeds threshold?
  • ActionFind latest merged edge-config commitGitLabGitLab
  • ActionOpen revert merge requestGitLabGitLab
  • OutputPost MR + before/after ratio to on-call channelSlack

What it does

This sentinel runs every 15 minutes, pulls the zone-level cache hit ratio from the Cloudflare GraphQL Analytics API, and compares it to the trailing 24-hour baseline. When the ratio drops past your threshold (default 8 points), it identifies the most recent merged change to your edge config repo, reverts that commit, and opens a GitLab merge request so an operator can ship the rollback with one click.

When to use it

Use it when cache rules, Page Rules, or `_headers`/CDN config live in a Git repo and a bad edit can silently collapse hit ratio — driving up origin load and bills before anyone notices. It turns a slow, after-the-fact incident into a pre-staged fix.

How it works

  1. 1Schedule fires every 15 minutes.
  2. 2Cloudflare returns current and trailing-baseline cache hit ratio for the zone.
  3. 3A logic step checks whether the drop exceeds the threshold; if not, the run ends quietly.
  4. 4GitLab is queried for the latest merged commit touching the edge-config path, which becomes the rollback target.
  5. 5GitLab creates a revert branch and opens a merge request titled with the regression details.
  6. 6Slack posts the MR link and the before/after ratio to the on-call channel.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect CloudflareWorkers, Pages, R2, KV — the edge stack.
  2. 2
    Connect GitLabRepos, MRs, pipelines, registry.
  3. 3
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.