Frontend observability rum instrumentation

From VincentChuWaiChow/vanguard-frontier-agentic · View interactive version

Frontend observability rum instrumentation is an AI agent skill from the GitHub repository VincentChuWaiChow/vanguard-frontier-agentic. Design or review browser-side Real User Monitoring instrumentation for Core Web Vitals (LCP, INP, CLS) using the web-vitals attribution build and distributed tracing via OpenTelemetry Web, enforcing lab-vs-field evidence labeling, sampling/cardinality sizing, and PII-in-telemetry controls, with libr

How to use this skill

Skill file

Frontend Observability RUM Instrumentation

Purpose

Lab-only performance testing (Lighthouse, synthetic CI runs) systematically misses the device/network diversity of real users, and ad-hoc telemetry instrumentation routinely leaks PII into span attributes or blows up observability cost through unsampled high-cardinality export. This skill wires and reviews field RUM (web-vitals + OpenTelemetry Web) with explicit evidence labeling and privacy/cost guardrails baked in from the start.

When to use

Use this skill when the user asks to:

When NOT to use

Context7 Documentation Protocol

web-vitals and OpenTelemetry Web packages ship breaking API changes across major versions (attribution-build option shapes, sampler class names, exporter constructor options), and memorized snippets go stale. Before writing or reviewing instrumentation code:

  1. Call ToolSearch with query "context7" (or "select:mcp__Context7__resolve-library-id,mcp__Context7__query-docs") to load the Context7 tools if not already loaded this session.
  2. Call mcp__Context7__resolve-library-id for web-vitals and/or opentelemetry-js before making any claim about their current API shape. Verified IDs as of this skill's updated date: /googlechrome/web-vitals and /open-telemetry/opentelemetry-js.
  3. Call mcp__Context7__query-docs for the specific mechanism in scope — e.g. "attribution build generateTarget option", "INPAttributionReportOpts durationThreshold", "WebTracerProvider spanProcessors config", "TraceIdRatioBasedSampler" — before ruling on it. Do this per review; do not reuse a prior session's memory of these APIs.
  4. Known facts verified via Context7 as of this skill's updated date: the attribution build (web-vitals/attribution) accepts AttributionReportOpts (reportAllChanges, generateTarget) on onCLS/onFCP/onLCP/onTTFB, and INPAttributionReportOpts additionally exposes durationThreshold (default 40) and includeProcessedEventEntries (default true) on onINP. WebTracerProvider (from @opentelemetry/sdk-trace-web) takes a spanProcessors array in its constructor — do not tell a user to call a separate addSpanProcessor method as the primary pattern without checking the installed SDK version. TraceIdRatioBasedSampler takes a single ratio argument (0–1) and is normally wrapped in ParentBasedSampler({ root: ... }) so that downstream/parent sampling decisions are respected.
  5. If Context7 is unavailable or returns no relevant match, fall back to official_docs / references/*.md and mark the claim documentation-based (Context7 unavailable) rather than presenting it as freshly verified.
  6. Never invent a web-vitals metric field, attribution property, OpenTelemetry exporter option, or sampler class that no queried source confirms.

Lean operating rules

References

Load these only when needed:

Response minimum

Return, at minimum:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.