Monitoring

KeyValue
StatusActive
OwnerQA Automation
Updated2026-03-26
ScopeProactive monitors that run alongside or outside the main test suites

Monitoring in this repo is broader than scheduled Playwright suites. Some risks are better caught by focused monitors than by full regression runs. The job of a monitor is not to prove the whole site works. It is to catch a narrow class of breakage early and cheaply.

Monitoring Versus Testing

MonitoringTesting
narrow and focusedbroader behavioral coverage
often runs more frequentlyusually runs on a schedule tied to risk or cost
catches drift earlyconfirms user-facing behavior more deeply
optimized for signal-to-noiseoptimized for confidence

Current Monitors

MonitorWhat It Watches
consent monitorconsent dialog presence and selector health
selector monitorknown key selectors across sites
robots.txt and sitemap monitorcrawl policy changes and sitemap health
URL monitorbroken links, redirects, bad targets, crawl drift
Grafana visual monitorempty or broken dashboard panels in a real browser

The consent monitor exists because consent breakage can make many unrelated tests look broken.

What It ChecksWhy It Matters
dialog presencelegal and access path
accept interactionusers can get past the wall
selector healthprevents false failures in many suites

Main command: npm run monitor:consent

Selector Monitor

The selector monitor is a lightweight “are our assumptions still true?” check for important surfaces.

What It CatchesExample
removed selectorsredesign or CMS changes
weakened fallbacksconfig drift
site-specific breakageone site changes while others remain healthy

Main command: npm run monitor:selectors

robots.txt And Sitemap Monitor

This is one of the most useful narrow monitors in the repo because it watches a high-stakes surface that product teams can change without obviously breaking the homepage.

Monitor PartWhat It Detects
robots.txt change detectioncrawl-policy drift and accidental blocking
sitemap healthmissing or broken sitemap endpoints

Current operating model:

  • daily check
  • all 16 CNC sites
  • deduplicated alerting
  • stored state for change detection
%%{init: {'theme':'base', 'themeVariables': {'primaryColor': '#4a90d9', 'primaryTextColor': '#fff', 'primaryBorderColor': '#2c6fad', 'lineColor': '#555', 'fontFamily': 'sans-serif'}}}%%
flowchart TD
    S["For each of 16 sites"] --> A["Fetch robots.txt"]
    A --> B["SHA-256 hash"]
    B --> C{Changed?}
    C -- Yes --> D["Slack alert\nwith line diff\n@Martin"]
    C -- No --> E["Update lastChecked"]

    A --> F["Parse Sitemap: lines\n(auto-discovered)"]
    F --> G["Fetch each sitemapindex\n(GET)"]
    G --> H["Extract nested loc URLs"]
    H --> I["Check all URLs\nconcurrently"]
    I --> J{Any non-200?}
    J -- Yes --> K["Deduplicate\n(7-day window)"]
    K --> L["Slack alert\nfor new failures\n@Martin"]
    J -- No --> M["All OK — silent"]

Main command: npm run monitor:robots-txt

URL Monitor

The URL monitor is the link-quality system. It crawls, classifies, deduplicates, and reports broken or risky links.

StrengthWhy It Matters
crawl depth variantsteams can choose speed versus coverage
source trackingbroken links can be traced back to where they were found
deduplicationoperators get one useful incident instead of spam
historyrecurring URL issues are easier to spot

Main commands:

GoalCommand
standard crawlnpm run monitor:urls:crawl
nav-focused crawlnpm run monitor:urls:crawl:nav
full crawlnpm run monitor:urls:crawl:full
broken-link reportnpm run monitor:urls:broken
Slack summarynpm run monitor:urls:slack

Grafana Visual Monitor

This monitor checks dashboards in a browser instead of trusting API-level health alone.

It Looks ForWhy It Matters
“No data” panelsquery or datasource drift
broken panel renderingdashboard can be technically deployed but not useful
missing expected panelsaccidental dashboard regressions

Main commands:

GoalCommand
run monitornpm run monitor:grafana
run and alertnpm run monitor:grafana:slack

How To Think About Frequency

Monitor TypeGood Frequency
consent and selector healthfrequent
robots.txt and sitemap healthdaily
URL monitoringscheduled depth depending on cost
Grafana visual qualityregular, but not as often as low-cost health checks

Good Operational Practice

  • use focused monitors to catch narrow but expensive problems early
  • do not expect a single monitor to replace a full suite
  • route monitor alerts differently from regression alerts when the urgency differs
  • prefer one well-clustered alert over many noisy duplicates

One practical pattern looks like this:

  1. monitors catch drift early
  2. Slack posts a low-noise alert
  3. operator checks whether the issue is isolated or broad
  4. if needed, a deeper suite runs to confirm user impact
NeedGo To
full suite purposesTest Types
alert behaviorReporting
URL monitoring deep diveURL Monitor System
robots.txt monitor deep diverobots.txt & Sitemap Monitor