Skip to content

Commit a1b9c84

Browse files
authored
Add traces to look for app insights mismatch. (#2689)
1 parent 38693e4 commit a1b9c84

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

client/src/app/function-monitor/function-monitor.component.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ScenarioService } from './../shared/services/scenario/scenario.service';
2-
import { ScenarioIds, Constants } from './../shared/models/constants';
2+
import { ScenarioIds, Constants, LogCategories } from './../shared/models/constants';
33
import { ComponentNames } from 'app/shared/models/constants';
44
import { Component, Injector } from '@angular/core';
55
import { Observable } from 'rxjs/Observable';
@@ -15,6 +15,7 @@ import { PortalResources } from '../shared/models/portal-resources';
1515
import { TranslateService } from '@ngx-translate/core';
1616
import { ApplicationInsightsService } from '../shared/services/application-insights.service';
1717
import { SiteService } from '../shared/services/site.service';
18+
import { LogService } from '../shared/services/log.service';
1819

1920
@Component({
2021
selector: ComponentNames.functionMonitor,
@@ -34,6 +35,7 @@ export class FunctionMonitorComponent extends NavigableComponent {
3435
private _scenarioService: ScenarioService,
3536
private _translateService: TranslateService,
3637
private _applicationInsightsService: ApplicationInsightsService,
38+
private _logService: LogService,
3739
public globalStateService: GlobalStateService,
3840
injector: Injector
3941
) {
@@ -129,6 +131,11 @@ export class FunctionMonitorComponent extends NavigableComponent {
129131
message: this._translateService.instant(PortalResources.monitoring_appInsightsIsNotFound),
130132
resourceId: this.functionMonitorInfo.functionAppContext.site.id
131133
};
134+
135+
this._logService.error(
136+
LogCategories.applicationInsightsKeyNotFound,
137+
errorIds.applicationInsightsInstrumentationKeyMismatch,
138+
'Application Insights Instrumentation Key not found');
132139
}
133140

134141
this.monitorConfigureInfo = {

client/src/app/shared/models/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ export class LogCategories {
271271
public static readonly addSlot = 'AddSlot';
272272
public static readonly applicationInsightsQuery = 'ApplicationInsightsQuery';
273273
public static readonly applicationInsightsConfigure = 'ApplicationInsightsConfigure';
274+
public static readonly applicationInsightsKeyNotFound = 'ApplicationInsightsInstrumentationKeyNotFound';
274275
public static readonly serverFarm = 'ServerFarm';
275276
}
276277

0 commit comments

Comments
 (0)