Application Insights
Application Insights is a powerful extensible Application Performance Management (APM) service for developers and DevOps professionals. It provides deep insights into your applications, enabling you to monitor availability, performance, and usage patterns in real time.
Key Features
- Telemetry Collection – Automatic collection of requests, exceptions, traces, dependencies, and custom events.
- Live Metrics Stream – Real‑time performance metrics with no additional configuration.
- Analytics Query Language (Kusto) – Rich querying capabilities for custom dashboards and alerts.
- Distributed Tracing – End‑to‑end correlation across services and micro‑services.
- AI‑Powered Anomalies – Automatic detection of performance anomalies and failure patterns.
Getting Started
- Create an Application Insights resource in the Azure portal.
- Install the SDK for your platform (C#, Java, JavaScript, Python, etc.).
- Configure instrumentation key or use Azure Managed Identity for seamless connection.
- Deploy your application and start seeing telemetry within minutes.
Sample: Adding Application Insights to an ASP.NET Core App
// Program.cs
using Microsoft.ApplicationInsights.Extensibility;
var builder = WebApplication.CreateBuilder(args);
// Add Application Insights
builder.Services.AddApplicationInsightsTelemetry();
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.Run();
Sample: Sending Custom Events from JavaScript
// index.html (client side)
Powerful Queries with Kusto
requests
| where timestamp > ago(24h)
| summarize count() by resultCode, bin(timestamp, 1h)
| order by timestamp desc