Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

VA/Skill App Insights Instrumentation Key not loaded #3365

@lshade

Description

@lshade

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

Can you share any logs, error output, etc.?

Any screenshots or additional context?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageNeeds to be triaged for assignmentType: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions