asp.net-coreblazor-server-sideazure-application-insights

Why is Application Insights showing no events


This is for a Blazor Interactive Server app. I add it to the app using:

builder.Logging.AddApplicationInsights();
builder.Services.AddApplicationInsightsTelemetry();

I then add an event using:

// class members
[Inject] 
protected TelemetryClient TelemetryClient { get; set; } = default!;

// bunch of code runs

var stopwatch = System.Diagnostics.Stopwatch.StartNew();
// bunch of code runs
stopwatch.Stop();
TelemetryClient.TrackMetric("Signup calendar get events", stopwatch.ElapsedMilliseconds);

I then pushed this up to the app, went to the app, and clicked through the pages that would cause the above TrackMetric() to be called.

I then went to Application Insights | Activity log and it shows... Slot Security events. Nothing else. I've set the resource to the dev slot of my applications erver, which is what I want to be measuring.

One weird thing on that, a resource I can select is ApplicationInsights-dev which is the Application Insights I am in. Does that make sense, that it can be looking at itself?

What am I getting wrong in this?


Solution

  • The Activity log for any Azure Resource shows activity regarding the management plane of the resource. So when a resource is modified it is logged there. It does not include anything regarding the data plane so you are looking at the wrong place. (source

    Go to the metrics section like shown below or write a custom query

    enter image description here