In services of asp.net we can set cloud_rolename for app insight. Using this our services team tracks error in app insight. How can i set it from angular. This is how i am running app insight in angular:
export class MonitoringService {
private appInsights: ApplicationInsights;
constructor(private router: Router) {
this.appInsights = new ApplicationInsights({
config: {
instrumentationKey: environment.appInsights.instrumentationKey,
},
});
this.appInsights.loadAppInsights();
this.loadCustomTelemetryProperties();
this.createRouterSubscription();
}
You can use Telemetry Initializers, the sample code:
var telemetryInitializer = (envelope) => {
envelope.tags["ai.cloud.role"] = "your role name";
envelope.tags["ai.cloud.roleInstance"] = "your role instance";
}
appInsights.addTelemetryInitializer(telemetryInitializer);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With