Fix sample and update dependencies / lock file#251
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Angular plugin sample to use the correct Application Insights configuration field and adjusts sample dependencies/release notes.
Changes:
- Switch sample production environment config from
instrumentationKeytoconnectionString. - Update router tracking in
AppComponentto derive the activated component viaActivatedRoute. - Add npm
overridesfor transitive dependencies and add a full changelog link toRELEASES.md.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sample/applicationinsights-angularplugin-sample/src/environments/environment.prod.ts | Aligns prod environment config with the connectionString field used by the telemetry service. |
| sample/applicationinsights-angularplugin-sample/src/app/app.component.ts | Updates activated component resolution logic for page view tracking. |
| sample/applicationinsights-angularplugin-sample/package.json | Adds dependency overrides intended to address transitive vulnerability updates. |
| RELEASES.md | Adds a full changelog comparison link for the referenced release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ort, function or class' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ts/environment.prod.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
sample/applicationinsights-angularplugin-sample/src/app/app.component.ts:33
getActivatedComponent()returnsroute.componentwhich can be a component type or a string (Angular router supports string component identifiers). In the string case,activatedComponent.namebecomesundefined, so page view telemetry will have no name. Consider tightening the return type (e.g.,Type<unknown> | string | null) and normalizing to a string name before callingtrackPageView(use the string directly, otherwise use the component type’s.name).
const activatedComponent = this.getActivatedComponent(this.route);
if (activatedComponent) {
this.appInsights.trackPageView({
name: activatedComponent.name,
uri: event.urlAfterRedirects,
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| production: true, | ||
| // connectionString: 'YOUR CONNECTION STRING' | ||
| instrumentationKey: "instrumentationKey=abcd" | ||
| connectionString: 'instrumentationKey=abcd' |
There was a problem hiding this comment.
The sample connectionString value ('instrumentationKey=abcd') doesn’t match the typical Application Insights connection string format (e.g., InstrumentationKey=...;IngestionEndpoint=...). Since this file is intended as a production example, consider updating it to a correctly-formatted placeholder to avoid copy/paste misconfiguration.
| connectionString: 'instrumentationKey=abcd' | |
| connectionString: 'InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://YOUR-REGION.in.applicationinsights.azure.com/' |
No description provided.