Skip to content

Commit

Permalink
Update Sample ApplicationInsightsService.tsx (#71)
Browse files Browse the repository at this point in the history
* Update ApplicationInsightsService.tsx

add custom property support

* Update ApplicationInsightsService.tsx

refactoring

---------

Co-authored-by: Nev <[email protected]>
  • Loading branch information
ravindracs0071 and MSNev authored Jul 2, 2024
1 parent 56ed4f1 commit 180c09e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ appInsights.loadAppInsights();

appInsights.addTelemetryInitializer((env:ITelemetryItem) => {
env.tags = env.tags || [];
env.tags["ai.cloud.role"] = "testTag";
env.tags["ai.cloud.role"] = "<app-role-frontend>";
//custom props
env.data = env.data || {};
env.data["ms-appName"] = "<frontend-name>";
env.data["ms-user"] = "<frontend-auth-user>";
env.data["ms-userid"] = "<frontend-auth-userid>";
});

export { reactPlugin, appInsights };
Expand Down

0 comments on commit 180c09e

Please sign in to comment.