-
Notifications
You must be signed in to change notification settings - Fork 528
VA/Skill App Insights Instrumentation Key not loaded #3365
Description
What project is affected?
Virtual Assistant and Skill
What language is this in?
C#
What happens?
I haven't seen telemetry coming into App Insights for my VA and Skills.
I saw that this part of appsettings.json:
"ApplicationInsights": {
"InstrumentationKey": "<my key>"
},
Needed to change to this in order to be loaded into BotSettingsBase.cs in Startup.cs
"appInsights": {
"InstrumentationKey": "<my key>"
},
But even with that change, I'm not seeing the logs.
I think the problem could be that the IBotTelemetryClient telemetryClient in all of the dialogs has an empty string for the InstrumentationKey, but I don't see a way to manually set the InstrumentationKey for this.
What are the steps to reproduce this issue?
I have a VA and Skills running with v4.7.2
I made the above change to appsettings.json
This is what it looks like in the Startup.cs:
// Configure telemetry
services.AddApplicationInsightsTelemetry();
services.AddSingleton<IBotTelemetryClient, BotTelemetryClient>();
services.AddSingleton<ITelemetryInitializer, OperationCorrelationTelemetryInitializer>();
services.AddSingleton<ITelemetryInitializer, TelemetryBotIdInitializer>();
services.AddSingleton<TelemetryInitializerMiddleware>();
// Configure Logging Personal Information
services.AddSingleton(sp =>
{
var telemetryClient = sp.GetService<IBotTelemetryClient>();
return new TelemetryLoggerMiddleware(telemetryClient, logPersonalInformation: true);
});
Set a breakpoint in the MainDialog constructor where TelemetryClient = telemetryClient; and you'll see TelemetryClient.InstrumentationKey == ""
What were you expecting to happen?
Expected to see events in AppInsights like "WaterfallStep," etc