Monitoring for DevOps: Azure Monitor & App Insights
Configure monitoring for DevOps environments with Azure Monitor, Application Insights, and GitHub Insights. Set up telemetry collection, alerts, and pipeline monitoring.
Why monitoring completes the DevOps loop
Think of a car dashboard.
You have a speedometer, fuel gauge, temperature gauge, and warning lights. Without them, you are driving blind β you would not know you are speeding, running out of fuel, or overheating until something breaks. The dashboard gives you real-time information so you can react before disaster strikes.
Monitoring in DevOps is your applicationβs dashboard. Azure Monitor shows you how your infrastructure is performing. Application Insights shows you how your application is behaving from the userβs perspective. Pipeline monitoring tells you when builds break or deployments fail. Without monitoring, you are deploying code into a black hole.
The Azure Monitor ecosystem
Azure Monitor is the umbrella platform for all monitoring, logging, and alerting in Azure. It collects data from multiple sources and provides tools to analyse and act on that data.
Architecture overview
Data Sources Collection Analysis & Action
βββββββββββββ ββββββββββ ββββββββββββββββββ
Applications βββ App Insights βββ Log Analytics workspace
VMs βββ VM Insights βββ Metrics Explorer
Containers (AKS) βββ Container βββ Workbooks
Insights
Storage accounts βββ Storage βββ Alerts
Insights
Network resources βββ Network βββ Dashboards
Insights
Azure resources βββ Diagnostic βββ Autoscale
Settings
Custom sources βββ Data Collection βββ Azure Monitor
Rules (DCR) SCOM MI
Two data types
| Data Type | What It Is | Storage | Query Language |
|---|---|---|---|
| Metrics | Numeric time-series data β CPU percentage, request count, response time | Azure Monitor Metrics store (fast, 93-day retention) | Metrics Explorer (visual) |
| Logs | Structured event records β requests, exceptions, traces, custom events | Log Analytics workspace (configurable retention, up to 12 years) | KQL (Kusto Query Language) |
Metrics are lightweight and near-real-time (1-minute granularity). Use them for dashboards and alerts on current state. Logs are rich and queryable. Use them for deep investigation, correlation, and historical analysis.
Application Insights
Application Insights is the application performance monitoring (APM) component of Azure Monitor. It monitors your live applications and detects performance anomalies.
Telemetry types
| Telemetry Type | What It Captures | Example |
|---|---|---|
| Requests | Incoming HTTP requests to your app | GET /api/users took 234ms, returned 200 |
| Dependencies | Outgoing calls to external services | SQL query took 89ms, HTTP call to payment API took 1.2s |
| Exceptions | Unhandled and tracked exceptions | NullReferenceException in OrderService.Process() |
| Traces | Custom diagnostic messages (your ILogger output) | βProcessing order 12345 for customer ABCβ |
| Page views | Client-side page load telemetry | Homepage loaded in 1.8s on Chrome |
| Custom events | Business-relevant events you define | βUser completed checkoutβ, βReport generatedβ |
| Custom metrics | Business-relevant numeric values | βCart value: $147β, βQueue depth: 23β |
Instrumentation approaches
| Approach | How It Works | When to Use |
|---|---|---|
| Auto-instrumentation (codeless) | Enable via Azure Portal, ARM, or agent. No code changes needed. | Azure App Service, Azure Functions, VMs with the agent. Fastest path to monitoring. |
| SDK integration | Add the Application Insights SDK NuGet/npm package and configure in code. | When you need custom telemetry (custom events, metrics), or when auto-instrumentation is not available for your platform. |
| OpenTelemetry | Use the Azure Monitor OpenTelemetry exporter. Vendor-neutral instrumentation. | New applications, multi-cloud scenarios, or teams adopting OpenTelemetry standards. |
Connection strings vs instrumentation keys
Application Insights connection strings replaced instrumentation keys as the recommended configuration method. Connection strings contain the ingestion endpoint and the instrumentation key, supporting regional ingestion endpoints and private link scenarios. Always store the connection string in application settings or Key Vault β never hardcode it.
Insights services: VM, Container, Storage, Network
VM Insights
Monitors virtual machine performance and health:
- CPU, memory, disk, and network metrics per VM
- Process-level detail (which processes consume resources)
- Dependency mapping β visualises network connections between VMs and external services (requires the Dependency Agent)
- Data sent to Log Analytics workspace for KQL analysis
Enable: Install the Azure Monitor Agent (AMA) and configure a Data Collection Rule (DCR).
Container Insights
Monitors AKS clusters and container workloads:
- Node and pod resource utilisation (CPU, memory)
- Container restart counts and failure rates
- Kubernetes events (pod scheduling, image pull failures)
- Prometheus metrics integration (custom app metrics)
- Live logs β real-time container stdout/stderr in the portal
Enable: Enable during AKS cluster creation or add the monitoring add-on later. Uses Azure Monitor Agent with ContainerLogV2 schema.
Storage Insights and Network Insights
- Storage Insights β unified view of storage account health, performance, capacity, and transactions across all accounts
- Network Insights β topology visualisation, connectivity monitoring, traffic analysis, and NSG flow logs
GitHub monitoring
Actions insights
GitHub provides workflow monitoring through the Actions tab:
- Workflow run history β success/failure rates, duration trends
- Usage metrics β runner minutes consumed (billable minutes for private repos)
- Workflow visualisation β job dependencies and timing breakdown
Configuring charts (repository insights)
Repository Insights (under the Insights tab) provide:
- Pulse β summary of activity (PRs merged, issues closed, contributors active)
- Contributors β commit frequency by contributor over time
- Traffic β page views, unique visitors, referral sources, popular content
- Dependency graph β all dependencies and their known vulnerabilities
For organisations with GitHub Enterprise, GitHub Insights provides custom charts and metrics across all repositories.
Audit log
The GitHub audit log records administrative and security events:
- Organisation membership changes
- Repository permission changes
- Branch protection modifications
- Secret scanning bypass events
- Workflow permission changes
Audit logs can be streamed to external SIEM systems (Azure Sentinel, Splunk) for long-term retention and correlation.
Pipeline alerts
Azure DevOps notifications
Azure DevOps supports built-in notifications for pipeline events:
| Event | Notification Type | Configuration |
|---|---|---|
| Build completes | Email, Teams webhook | Personal or team subscription |
| Build fails | Email, Teams webhook, service hook | Team subscription (auto-notify assignees) |
| Release deployment pending | Email to approvers | Automatic when approval gates are configured |
| Release deployment fails | Email, Teams webhook | Team subscription |
| Work item linked to build | Personal subscription |
Service hooks extend notifications to external systems β Slack, Teams, webhooks, Azure Functions, Grafana.
GitHub Actions alerts
GitHub Actions does not have a built-in alerting system like Azure DevOps. Instead, use:
- Repository notification settings β watch workflow runs for failure notifications
- Third-party GitHub Apps β Slack GitHub integration, Teams GitHub connector
- Custom webhook steps β add a job step that posts to Slack/Teams on failure:
- name: Notify on failure
if: failure()
uses: slackapi/slack-github-action@v2
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
payload: |
"text": "Workflow failed: ${{ github.workflow }}"
Work item creation from alerts
Azure Monitor alerts can automatically create work items in Azure DevOps or GitHub Issues when triggered:
- Configure an Azure Monitor alert rule (e.g., response time > 2 seconds)
- Attach an action group with an βAzure DevOps Work Itemβ or βWebhookβ action
- When the alert fires, a bug or task is created in your backlog automatically
This closes the loop: production issue β alert β work item β fix β deploy β monitor.
Scenario: Kai sets up monitoring for Launchpad Labs
π Kai Tanakaβs SaaS startup has just deployed their first production service to AKS. Sam (CTO) asks: βHow do we know it is working?β
Kaiβs monitoring stack:
- Application Insights β auto-instrumented on the .NET API via the AKS monitoring add-on. Captures requests, dependencies, and exceptions.
- Container Insights β enabled on the AKS cluster. Monitors pod health, node resource usage, and restart counts.
- Azure Monitor alerts β configured for: response time P95 over 2s (warning), error rate over 5% (critical), pod restart count over 3 in 10 minutes (critical).
- Action groups β critical alerts create GitHub Issues automatically via webhook, plus Slack notification.
- GitHub Actions monitoring β Slack integration notifies the team channel on deployment failures.
Result: Within the first week, Container Insights detects a memory leak causing pod restarts. The alert fires, a GitHub Issue is created, Riku (frontend dev) picks it up, and the fix is deployed the same day.
Exam tip: Know which Insights service for which resource
The exam may describe a resource type and ask which monitoring solution to use:
- Web app or API β Application Insights
- Virtual machines β VM Insights (with Dependency Agent for mapping)
- AKS / containers β Container Insights
- Storage accounts β Azure Monitor for Storage (Storage Insights)
- VNets, load balancers, NSGs β Azure Monitor for Networks (Network Insights)
- All of the above, unified β Azure Monitor (umbrella) with Log Analytics workspace
Also remember: all Insights services send data to a Log Analytics workspace, where you can write KQL queries to correlate data across resource types.
Knowledge check
Jordan wants to monitor an AKS cluster to see pod resource utilisation, container restart counts, and real-time container logs. Which service should he enable?
Nadia's Azure Monitor alert fires when the claims API response time exceeds 3 seconds. She wants a bug to be automatically created in Azure DevOps Boards. What should she configure?
π¬ Video coming soon
Monitoring for DevOps: Azure Monitor & App Insights
Next up: Metrics and KQL: Analysing Telemetry and Traces