The user wants a "Core Web Vitals incident playbook."
This playbook needs to cover specific CWV metrics: INP (Interaction to Next Paint), LCP (Largest Contentful Paint), and CLS (Cumulative Layout Shift).
For each of these, the user requests specific elements: "spikes," "regressions," "anomalies" (implying detection/analysis), a "root cause tree," and "comms templates."
Target Audience: Developers, SREs (Site Reliability Engineers), Performance Engineers, and potentially Engineering Managers.
Tone: Professional, actionable, structured, and urgent (it's an incident playbook).
Structure of the Playbook:
- Introduction/Preamble: What is this document? When to use it?
- General Incident Workflow: A brief overview of Triage -> Diagnose -> Mitigate -> Communicate.
- Metric-Specific Sections (The core request):
- INP (Interaction to Next Paint): The newest core vital. Focus on JS execution, event handlers, and rendering.
- LCP (Largest Contentful Paint): Focus on server speed, resource loading, and render blocking.
- CLS (Cumulative Layout Shift): Focus on layout stability, images, and dynamic content.
- For each section, I need:
- Symptom/Definition: What does a spike/regression look like?
- Root Cause Tree: A visual or list-based hierarchy of potential causes.
- Mitigation Steps: Immediate fixes.
- Communication Templates: Status updates for Slack/Email/PagerDuty.
Drafting Content - Section by Section:
-
Intro: Keep it brief. Define the severity (SEV-2 or SEV-3 usually for performance, unless it causes total outage).
-
Section 1: INP (Interaction to Next Paint)
- Context: Replaces FID. Measures responsiveness. Bad INP > 500ms (poor), < 200ms (good).
- Spikes: Usually caused by heavy JS execution during a click.
- Root Cause Tree:
- Main Thread blocked?
- Event Handler heavy?
- React/Vue/Angular re-rendering?
- Playbook steps: Profile in Chrome DevTools (Performance tab), check for long tasks.
-
Section 2: LCP (Largest Contentful Paint)
- Context: Loading performance. Good < 2.5s.
- Regressions: Suddenly slower. Often deployment-related or CDN cache miss.
- Root Cause Tree:
- Server slow? (TTFB)
- Resource blocked? (JS/CSS)
- Client rendering? (SSR vs CSR)
- Playbook steps: Check Network waterfall, backend traces, caching headers.
-
Section 3: CLS (Cumulative Layout Shift)
- Context: Visual stability. Good < 0.1.
- Anomalies: Unexpected jumping.
- Root Cause Tree:
- Images without dimensions?
- Fonts swapping (FOIT/FOUT)?
- Dynamic inserts (ads/banners)?
- Playbook steps: Inspect element, check CSS, look for late-loading assets.
-
Section 4: Root Cause Analysis (RCA) Framework (The "Tree"):
- The prompt asked for a "root cause tree." I should probably create a unified visualization or text-based tree structure, or keep them within the specific sections. I'll likely do a consolidated section or integrate them into the specific metrics. Let's integrate them for context, but maybe add a "General Performance RCA Tree" section to tie it all together. Actually, specific trees per metric are more actionable. I will do specific trees within the sections.
-
Section 5: Communication Templates:
- Need templates for:
- Acknowledgment (We know it's happening).
- Investigation Update (Here is what we found).
- Mitigation/Fix (We rolled back/pushed a patch).
- Resolution (Post-mortem pending).
Refining the Details:
- INP Nuance: It's about the longest interaction. Need to mention
interactionId or Long Animation Frames API if getting technical, but keep it accessible.
- LCP Nuance: Distinction between Server-side (TTFB) and Client-side (Render blocking).
- CLS Nuance: Often tricky because it happens during loading or interaction.
Formatting: Use Markdown. Bold headers, bullet points, code blocks for templates.
Self-Correction during drafting:
- Initial thought: Just list tools. Correction: Focus on process. "Step 1: Check X, Step 2: Check Y."
- Initial thought: Group comms together. Correction: Keep them at the end for easy copy-pasting.
- Missing piece: The prompt asks for "root cause tree" singular. I will create a comprehensive "Root Cause Tree" diagram at the start, then dive into specifics. This covers the holistic view.
Drafting the Root Cause Tree (Text-based):
- Performance Issue -> Backend vs Frontend?
- Backend -> Database, API, Server CPU.
- Frontend -> JS, CSS, Network, Render.
Let's reorganize. I will structure the playbook by "Incident Type" (Metric).
- Playbook Header
- Metric 1: INP (Responsiveness)
- Root Cause Tree
- Triage Steps
- Metric 2: LCP (Load Speed)
- Root Cause Tree
- Triage Steps
- Metric 3: CLS (Stability)
- Root Cause Tree
- Triage Steps
- Communication Templates
This looks solid. I will ensure the distinction between "field data" (CrUX/RUM) and "lab data" (Lighthouse) is mentioned, as incident response usually triggers from RUM alerts.
Comms Templates specifics:
- Slack: Short, emoji-heavy.
- Email/Status Page: Formal, reassuring.
Let's write it.
This playbook outlines the standard operating procedure for responding to Core Web Vitals (CWV) incidents. It covers the three main metrics—INP, LCP, and CLS—providing a root cause analysis framework, specific remediation steps, and communication templates.
📑 Core Web Vitals Incident Playbook
Scope: This playbook is triggered when Real User Monitoring (RUM) thresholds breach the "Poor" threshold (Red) or show significant regression (Amber) in Google Search Console or internal dashboards (e.g., Datadog, New Relic).
| Metric | Good (Green) | Needs Improvement (Amber) | Poor (Red) |
|---|
| INP | ≤ 200ms | 200ms – 500ms | > 500ms |
| LCP | ≤ 2.5s | 2.5s – 4.0s | > 4.0s |
| CLS | ≤ 0.1 | 0.1 – 0.25 | > 0.25 |
🚨 Phase 1: Triage & Detection
- Verify the Spike: Is this a statistical anomaly or a sustained regression? Check the 28-day trend vs. the 24-hour trend.
- Scope the Blast Radius:
- Device: Mobile, Desktop, or Both?
- Geography: Specific regions or global?
- Browser: Chrome, Safari, Firefox?
- Identify the Trigger:
- Was a deployment made in the last [Time Window]?
- Did traffic spike (e.g., flash sale, bot traffic)?
- Did a third-party script change or load blocking assets?
🌳 Phase 2: Root Cause Analysis (The Decision Tree)
Use this logic tree to isolate the root cause based on the failing metric.
A. The INP (Interaction to Next Paint) Tree
Focus: Main Thread Congestion & Event Handlers
- Is the High INP on Input or Interaction?
- If on Load: Likely aggressive JS execution during page load blocking TBT (Total Blocking Time). -> Throttle JS execution.
- If on Click/Key Press: Proceed to step 2.
- Profile the Interaction (Chrome DevTools > Performance Tab):
- Long Task identified? (>50ms).
- Yes: Is it Framework code or Third-Party?
- Framework: Heavy re-render (e.g., React reconciliation). -> Virtualize lists / Memoize components.
- Third-Party: Analytics/Chat widget blocking thread. -> Facade the widget /
requestIdleCallback.
- No Long Task, but delayed paint?
- Check for complex CSS calculations or Layout Thrashing. -> Optimize CSS / Batch DOM reads.
B. The LCP (Largest Contentful Paint) Tree
Focus: Server Speed & Resource Loading
- What is the LCP Element?
- Text/Block: Proceed to Step 2 (Critical Path).
- Image/Background Image: Proceed to Step 3 (Resource Loading).
- Analyze TTFB (Time to First Byte):
- High TTFB (>0.8s): Server is slow or dynamic HTML generation is heavy. -> Cache HTML edge-side / Optimize DB queries.
- Low TTFB: Issue is client-side. Check for Render Blocking Resources (sync JS/CSS). -> Defer non-critical JS / Inline critical CSS.
- Analyze Resource Load Time:
- High Load Delta: Is the image optimized?
- No: Compress/Convert to WebP/AVIF.
- Yes: Is it lazy-loaded? -> Remove lazy-loading from Above-the-Fold LCP image.
- Low Load Delta: Check for "Client-Side Rendering" (CSR) delay. -> Implement SSR or Static Site Generation (SSG).
C. The CLS (Cumulative Layout Shift) Tree
Focus: Visual Stability & DOM Injection
- Identify the "Shift" in DevTools (Layout Shifts region):
- Image/Video: Did the element lack explicit dimensions? -> Add
width and height attributes (or aspect-ratio CSS).
- Text: Did text jump?
- Font Swap: FOUT/FOIT issues. -> Use
font-display: optional or preload fonts.
- Dynamic Content: Did a banner/iframe load later and push content down? -> Reserve space (skeleton screens/min-height) for slow-loading slots.
🛠️ Phase 3: Incident Playbooks (Specific Metrics)
🟦 Incident: INP Spikes
Symptoms: Users report laggy buttons, unresponsive forms, or janky scrolling.
Immediate Actions:
- Code Rollback: If a specific commit introduced heavy event listeners, revert.
- Kill Third Parties: Use a Content Security Policy (CSP) or Tag Manager to temporarily disable non-essential tags (Chatbots, A/B testing tools) to see if INP drops.
- JavaScript Budget: Enforce a stricter bundle size limit.
Remediation:
- Break up Long Tasks using
setTimeout or scheduler.postTask.
- Use CSS
content-visibility: auto for off-screen elements.
🟦 Incident: LCP Regressions
Symptoms: Slow "feeling" of load, hero image appears late.
Immediate Actions:
- CDN Cache Purge: Check if the CDN is serving stale HTML or missing edge caches.
- Preconnect: Add
<link rel="preconnect" href="https://origin-of-lcp-image.com"> to the <head>.
- Image Optimization: Force serve a lower resolution or lower quality version for mobile temporarily.
Remediation:
- Fetch Priority: Add
fetchpriority="high" to the LCP image tag.
- Server Push (HTTP/2): Push the LCP asset if the connection allows (though Preload headers are often safer).
🟦 Incident: CLS Anomalies
Symptoms: Page elements "jump" or "dance" while loading.
Immediate Actions:
- Hide Dynamic Elements: Temporarily
display: none on the breaking container (e.g., an ad slot) until the ad loads.
- CSS Quick Fix: Apply a
min-height to the shifting container via an emergency CSS patch.
Remediation:
- Ensure all ads and embeds have reserved space defined in CSS.
- Stop injecting DOM nodes above existing content unless explicitly triggered by user action.
📢 Phase 4: Communications Templates
1. Internal Engineering Update (Slack/Teams)
🚨 Incident Alert: Core Web Vital Regression
Metric: [LCP / INP / CLS]
Status: Investigating
Severity: [SEV-2 / SEV-3]
Current Value: [e.g., 4.2s (Target < 2.5s)]
Impact: [e.g., Mobile users on 4G connections in US East]
Lead: @OnCallEngineer
Next Update: 30 mins.
2. Stakeholder / Product Update
Subject: Performance Regression Update - [Date]
Team,
We have detected a regression in our page load speed (LCP) affecting [Percentage]% of mobile users.
Root Cause: Preliminary analysis points to a new third-party analytics script blocking the main thread.
Business Impact: This may negatively impact our Google Search ranking and conversion rates if unaddressed within 48 hours.
Action: We are rolling back the specific script at [Time] today. We expect metrics to normalize within 6 hours post-rollback.
3. Public Status Page (If user-impacting)
Investigating: Web Interface Latency
We are currently investigating reports of slow page loading times on the checkout page. Users may experience delays when submitting forms. Our engineering team is actively working on a fix.