frontend: Add ApplicationInsights to the frontend#236
Open
sniok wants to merge 3 commits intoAzure:headlamp-downstreamfrom
Open
frontend: Add ApplicationInsights to the frontend#236sniok wants to merge 3 commits intoAzure:headlamp-downstreamfrom
sniok wants to merge 3 commits intoAzure:headlamp-downstreamfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a basic Microsoft Application Insights (AppInsights) integration to the frontend, wiring telemetry into existing Headlamp events, error boundaries, and the plugin API surface.
Changes:
- Initialize AppInsights early via a new
analyticsSetup.tsmodule loaded fromindex.html. - Add
trackEvent/trackExceptionhelpers and invoke them from Headlamp event middleware andErrorBoundary. - Expose analytics helpers through
window.pluginLibfor plugins; add required npm dependencies.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/redux/headlampEventSlice.ts | Sends a telemetry event for each headlamp/event dispatch. |
| frontend/src/plugin/index.ts | Exposes analytics helpers to plugins via window.pluginLib.analytics. |
| frontend/src/plugin/snapshots/pluginLib.snapshot | Updates snapshot to include the new analytics export. |
| frontend/src/lib/analytics.tsx | Adds wrapper helpers around AppInsights trackEvent / trackException. |
| frontend/src/components/common/ErrorBoundary/ErrorBoundary.tsx | Reports errors to AppInsights when an error boundary triggers. |
| frontend/src/analyticsSetup.ts | Initializes the AppInsights SDK early using an env-provided connection string. |
| frontend/index.html | Loads analyticsSetup.ts before the main app entrypoint. |
| frontend/make-env.js | Adds a default AppInsights connection string into generated .env. |
| frontend/package.json | Adds AppInsights SDK dependencies. |
| frontend/package-lock.json | Locks AppInsights SDK transitive dependencies. |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
skoeva
reviewed
Feb 20, 2026
Collaborator
skoeva
left a comment
There was a problem hiding this comment.
this could use a rebase since the CI fixes were merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basic setup for the analytics
trackEventtrackExceptionfunctionstrackEventtrackExceptionfunctions to plugins(CI fails as expected)
How to test
/tracknetwork requests