В сервисах asp.net мы можем установить cloud_rolename для понимания приложения. С помощью этого наша команда служб отслеживает ошибки в анализе приложений. Как я могу установить его из angular. Вот как я запускаю понимание приложения в 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();
}
Вы можете использовать Инициализаторы телеметрии, пример кода:
var telemetryInitializer = (envelope) => {
envelope.tags["ai.cloud.role"] = "your role name";
envelope.tags["ai.cloud.roleInstance"] = "your role instance";
}
appInsights.addTelemetryInitializer(telemetryInitializer);
Я получаю, что объект, возможно, 'undefined'.ts