3
votes

Here is the setup:

Issue: During debugging here is the observation:

  • Visual Studio debug telemetry only shows telemetry from the API project. And doesn't show for the other 4 console apps.
  • When I go to the Azure Portal, and search in the AI resource, I can see telemetry for the other 4 projects. Don't see for the API project.

What could I be missing? Have been struggling for a couple of days now...

1
Observed the Debug output in Visual Studio. Seeing that the telemetry is being generated for all projects. There is a difference for Web vs Console projects. The telemetry for the WebAPI project starts with "Application Insights Telemetry (unconfigured):" For the Console projects, it starts with "Application Insights Telemetry:"Ravi Chinni
So it appears that VS doesn't think AI is configured for web project, and showing the telemetry locally only. For console projects the telemetry is being sent to azure, and is not being shown locally. I have strictly followed the instructions at github.com/Microsoft/ApplicationInsights-aspnetcore/wiki/… to configure the WebAPI and Console projects.Ravi Chinni
Found the reason for "(unconfigured)" text in the WebAPI AI output. It was just because the appsettings.json was in wrong location. Fixed it and dont see the text anymore. The original issue still exists though.Ravi Chinni
On further troubleshooting, the original issue happens only when it is a combination of WebAPI + Console projects. Just debugging two console projects together does not cause the issue.Ravi Chinni
WebAPI project outputs the telemetry starting with ""name":"Microsoft.ApplicationInsights.Dev.7eccb92b0d144a698703a36b70d05f65.Event"" Console App outputs it as ""name":"Microsoft.ApplicationInsights.7eccb92b0d144a698703a36b70d05f65.Event"" Notice the ".Dev" in the WebAPI output. VS is only showing those messages and ignoring the rest. Something related to Hosting Environment?Ravi Chinni

1 Answers

0
votes

My guess would be your instrumentation key is not getting set for some reason. Can you try logging this property out to the console:

 Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey

That should be your key, if it's empty try posting what you have for your configuration setup for the api