Skip to content

Telemetry

The Telemetry module provides monitoring and analytics for the Blazor WebAssembly client: it captures unhandled exceptions via a global error boundary, tracks page views automatically through router events, and captures user-action telemetry through an injectable service — giving full observability into user behavior, feature adoption, and application health.

Component Purpose
AnalyticsService.cs / IAnalyticsService.cs Wraps the telemetry implementation — unified methods for user actions, UI errors, time-saving metrics, and login events
BlazorApplicationInsights External NuGet library providing the underlying client-side telemetry infra
MainLayout.razor Wires into the Blazor router for automatic page-navigation tracking via LocationChanged
Core_GlobalErrorBoundary.razor Global UI error boundary — captures unhandled exceptions and forwards them to the analytics pipeline
  • Direct App Insights connection: unlike standard data operations (which hit the Functions backend), raw telemetry is sent directly to Azure Application Insights, using the connection string/instrumentation key in Client/wwwroot/appsettings.json.
  • Dual-track logging: routine telemetry and stack traces go straight to App Insights, but critical crashes caught by Core_GlobalErrorBoundary may also dispatch to POST /api/bugs to log a formal bug ticket (see Core Module).
  • Page views — triggered automatically by subscribing to the Router’s LocationChanged event in MainLayout.razor, firing a “PageNavigated” custom event on every URL change.
  • User actions — individual components inject IAnalyticsService to manually log high-value events (e.g. “Save Estimate”, “Submit Timesheet”), often passing a dictionary of custom properties for context.
  • ErrorsCore_GlobalErrorBoundary.razor captures exceptions during the Blazor OnErrorAsync lifecycle hook and logs them with the failing component’s UI context.
  • Identity binding — login events are tracked during auth initialization in MainLayout.razor, binding the telemetry session to the authenticated Entra ID user.