2. Adding More Telemetry to Application Insights & Dashboards

David Thielen 3,121 Reputation points
2024-08-03T16:52:54.6933333+00:00

Hi all;

I have a Blazor Interactive Server app using ASP.NET version 8. And using Entity Frameworks for accessing the DB and the ASP.NET Identity Library for users & claims.

I have Application Insights connected to the app via the AI SDK. I have the following configuration & extension questions to make better use of Application Insights & Dashboards. (Editorial comment - all of monitoring, metrics, application insights, etc. is really well designed and provides pretty much everything one could ask for.)

If anything I am asking to accomplish below is a bad idea, please just let me know it's a bad idea and then no need to answer the specifics for that question.

  1. How can I turn Application Insights on/off using an environment variable? I want it off on my desktop and sometimes off for the dev slot on Azure.
  2. Just as builder.Logging.AddApplicationInsights() sends all my Ilogger calls to Application Insights, is there a way to send my Health Checks (which I have working) to Application Insights/Dashboards?
  3. Its not clear in all the documentation about what is classic Application Insights, what is Open Telemetry, and if they work together. Based on these steps for incorporating Application Insights I am using the classic Application Insights – correct?
  4. Can I use Open Telemetry also? Or should I stick with just Application Insights.
  5. When an exception occurs, do I want to call TelemetryClient.TrackException(exception);? If not, what do I call?
  6. What do I add to my Blazor app so it will tell Application Insights every page loaded and how long each took? Blazor is a SPA.
  7. What do I add to my Blazor app so it will tell when each session starts/ends? Blazor server uses SignalR so the session is the start/end of the circuit.
  8. What do I add to my Blazor app so it tracks what user is doing what? My app uses the ASP.NET Identity Library for users (and claims).
  9. When the user calls search in my app I want to save the time, call my Search method, then log the elapsed time to Application Insights. How do I do this?

thanks - dave

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,331 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,598 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,934 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.