observability-instrumentation

Implements type-safe client-side telemetry for React error boundaries, web-vitals, and HTTP failures.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/VilnaCRM-Org/claude-plugins --skill observability-instrumentation-vilnacrm-org
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: observability-instrumentation
Source: https://github.com/VilnaCRM-Org/claude-plugins/tree/main/plugins/react-frontend-sdlc/skills/observability-instrumentation
Command: npx skills add https://github.com/VilnaCRM-Org/claude-plugins --skill observability-instrumentation-vilnacrm-org

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @sentry/react, web-vitals, tsyringe, reflect-metadata.

What problem does it solve? Frontend applications often lack structured, type-safe telemetry, leaving teams blind to client-side errors, slow page loads, and failed API calls that degrade user experience. ## Core Features & Use Cases - Typed Telemetry Events: Define signals like LCP, CLS, INP, route transitions, and captured errors as concrete classes extending a TelemetryEvent base, emitted through an injectable reporter interface. - Sentry and Web-Vitals Wiring: Wire @sentry/react error boundaries at app, route, and lazy-chunk surfaces, and report web-vitals through the web-vitals package when observability is enabled. - Deferred Sink Support: When no RUM backend exists, emit the same typed events through a structured-log or no-op reporter so a live sink can be attached later without touching call sites. - Use Case: When adding a new route to a React SPA, use this Skill to add a route-level error boundary, emit a RouteTransitionEvent, and verify LCP/CLS/INP reporting against Lighthouse thresholds. ## Quick Start Add Sentry error boundaries and typed web-vitals reporting to my React app using the observability-instrumentation skill.

Frequently Asked Questions about observability-instrumentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Sentry error boundaries to a React app?▼

Wrap surfaces with Sentry.withErrorBoundary at the app shell, each route outlet, and lazy chunks, providing a fallback component and low-cardinality tags like surface and route. Initialize the SDK lazily via dynamic import so it stays out of the first-paint chunk.

How to report web-vitals like LCP, CLS, and INP in React?▼

Subscribe with onLCP, onCLS, and onINP from the web-vitals package inside an injectable WebVitalsReporter class, then forward each metric as a typed event through the reporter interface. Pair the signals with Lighthouse desktop and mobile audits so lab and field data agree.

Can I use typed telemetry without a Sentry or RUM backend?▼

Yes, keep the same event classes, boundaries, and reporter interface but register a structured-log reporter that writes one JSON object per signal, or a no-op reporter. Swapping to a live RUM sink later only changes the reporter implementation and its DI registration.

What context should I avoid sending to Sentry from the browser?▼

Never capture passwords, tokens, cookies, auth headers, raw form values, full API payloads, or user-entered text. Avoid high-cardinality tags like user IDs, session IDs, and full URLs with params, since they inflate RUM costs and risk leaking PII.

How do I test telemetry emission in React unit tests?▼

Register a reporter spy against the telemetry token in the tsyringe container, resolve the reporter or render the error boundary, and assert captured event names, values, and context precisely. Re-register the spy per test rather than clearing module-level singletons.

When should I not instrument metrics in the frontend?▼

Do not duplicate infrastructure metrics like server latency, error rates, RPS, or backend business KPIs that the platform or APM agent already emits. Browser telemetry should cover only client-side failures and user-perceived performance signals.