🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Azure Monitor for Data Platforms: KQL, Workbooks, and Alerts

Azure Data EngineeringAzure Monitor⭐ Premium
Azure Data Engineering

Observability is a pipeline component, not a dashboard project

13 min read📘Intermediate

Prerequisites

  • !Azure resource diagnostics and Log Analytics workspaces
  • !Basic Kusto Query Language or SQL familiarity
  • !Data Factory pipeline run concepts

What You'll Learn

  • 1Wire diagnostic settings so pipeline telemetry actually lands in Log Analytics
  • 2Write KQL that answers operational questions about pipeline health and cost
  • 3Build workbooks that serve both on-call engineers and platform leadership
  • 4Design alerts with thresholds that respect seasonality and cost

The two data planes: metrics and logs

Azure Monitor collects two complementary kinds of telemetry. Metrics are numerical time series with built-in aggregation: pipeline run counts, SU utilization, storage used capacity. They are cheap, near real time, and ideal for charts and threshold alerts. Logs are detailed event records: every ADF activity run with its inputs and durations, every Synapse SQL request with its text, every Key Vault access. They are richer, higher volume, and queried with Kusto Query Language in a Log Analytics workspace. Confusing the two leads to the classic mistake of trying to alert on a metric that only exists in logs, or paying Log Analytics ingest rates for data that a metric would have covered.

The pipeline that makes both useful is diagnostic settings. Every Azure data service emits some platform metrics by default, but the detailed logs only flow to Log Analytics, storage, or Event Hub when you configure diagnostic settings per resource. Forgetting to enable them on a newly created factory is the most common cause of "monitoring is not working" tickets, and the gap is invisible until an incident, because the absence of logs looks exactly like a quiet system.

TelemetryQuery languageLatencyCost profileBest use
Platform metricsKQL on AzureMetricsUnder a minuteLowThreshold alerts and utilization charts
Resource logsKQL on AzureDiagnosticsOne to fifteen minutesIngest and retention pricedRoot-cause analysis and audit
Activity logKQL on AzureActivityNear real timeIncludedWho changed what, when
Application insightsKQL custom tablesSecondsIngest pricedCustom application telemetry

KQL that answers real operational questions

The queries worth memorizing are the ones you run during incidents. Pipeline success rate over the last day, broken down by hour, tells you whether a failure is a spike or a slow degradation. The slowest activities across all factories surface the single pipeline that is quietly consuming your integration runtime budget. Failed runs grouped by error message convert a vague outage into a specific fix. Each of these is five lines of KQL against AzureDiagnostics, and each replaces fifteen minutes of clicking through the ADF monitoring UI during a incident bridge.

// Pipeline success rate by hour over the last 24 hours
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DATAFACTORY"
| where Category == "PipelineRuns"
| extend run_hour = bin(TimeGenerated, 1h)
| summarize
    total    = count(),
    succeeded = countif(Status_s == "Succeeded"),
    failed    = countif(Status_s == "Failed")
    by run_hour
| extend success_pct = 100.0 * succeeded / total
| project run_hour, total, succeeded, failed, success_pct
| render timechart

// Top 10 slowest activity runs across all factories, last 6 hours
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DATAFACTORY"
| where Category == "PipelineActivityRuns"
| where TimeGenerated > ago(6h)
| summarize avg_duration_ms = avg(DurationMs_d) by ActivityName_s, PipelineName_s
| top 10 by avg_duration_ms desc

// Failure clustering: what error messages are dominating right now
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DATAFACTORY"
| where Category == "PipelineRuns"
| where Status_s == "Failed"
| where TimeGenerated > ago(2h)
| summarize failures = count() by Message_s
| top 10 by failures desc

For storage cost governance, the UsedCapacity metric on the storage account, bucketed daily, is the single most useful chart to put in front of leadership, because it converts an abstract architecture decision into a slope they can plan against. Pair it with a breakdown by container using the storage analytics logs when you need to attribute growth to a specific pipeline.

// ADLS Gen2 capacity trend with week-over-week delta
AzureMetrics
| where ResourceProvider == "MICROSOFT.STORAGE"
| where MetricName == "UsedCapacity"
| summarize capacity_gb = avg(Average) / 1073741824 by bin(TimeGenerated, 1d)
| order by TimeGenerated asc
| extend wow_delta_gb = capacity_gb - prev(capacity_gb, 7)
| render timechart

Workbooks: one pane for on-call and leadership

Workbooks are interactive, parameterized dashboards that combine metrics, KQL results, and rich text in a single resource. Their advantage over a static dashboard is drill-down: an on-call engineer can start from a success-rate chart, click into a failing pipeline, and land on its activity runs without leaving the workbook. Parameter cells let the same workbook serve every team by letting them select their factory or pipeline from a dropdown.

Design workbooks in layers. The top layer is a small set of golden signals for leadership: pipeline success rate, average end-to-end latency, storage growth, and DBU spend. The second layer is for the on-call engineer: failed runs by pipeline, top errors, and integration runtime health. The third layer, often collapsed by default, holds the deep diagnostic queries you hope never to need. Keeping the layers separate prevents the dashboard that is so dense nobody uses it.

{
  "category": "workbook",
  "type": "workbook",
  "serializedData": {
    "version": "Notebook/1.0",
    "items": [
      {
        "type": "metric",
        "name": "ADF pipeline runs",
        "metric": "Microsoft.DataFactory/factories/PipelineRuns",
        "aggregationType": 4,
        "timeGrain": "PT1H"
      },
      {
        "type": "query",
        "name": "Failed pipelines by name",
        "query": "AzureDiagnostics | where ResourceProvider == 'MICROSOFT.DATAFACTORY' | where Category == 'PipelineRuns' | where Status_s == 'Failed' | summarize failures = count() by PipelineName_s | top 10 by failures desc"
      },
      {
        "type": "text",
        "content": "Click a pipeline name to open its run history in the ADF monitoring blade."
      }
    ]
  }
}

Alert design that respects seasonality

An alert threshold of "more than five failures per hour" is wrong for a retail data platform whose failure volume naturally triples on Monday mornings when weekend batch backlogs clear. Alert design starts from the baseline, not from a round number. Compute the historical distribution of the metric you care about, set the threshold relative to a standard deviation or a percentile, and review it quarterly as the system grows. Static thresholds that are never revisited become either permanently noisy or permanently silent, both of which erode trust in the alerting system.

Equally important is the action attached to the alert. Action groups can route to email, SMS, webhook, or an automation runbook that restarts a failed pipeline or scales a resource. A well-designed remediation alert does not wake a human when a known, safe automated fix exists; it only pages when the automated fix fails or when the blast radius is unknown. This keeps the human attention budget for the incidents that actually need judgment.

// Baseline for an adaptive alert: failures per hour over the trailing 14 days
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DATAFACTORY"
| where Category == "PipelineRuns"
| where Status_s == "Failed"
| where TimeGenerated > ago(14d)
| summarize failures_per_hour = count() by bin(TimeGenerated, 1h)
| summarize
    p50 = percentiles(failures_per_hour, 50),
    p95 = percentiles(failures_per_hour, 95),
    p99 = percentiles(failures_per_hour, 99)
// Alert threshold recommendation: p99 + small buffer, not a round number

Log Analytics cost: the bill nobody budgets for

Log Analytics charges for ingest, retention, and sometimes analysis. A diagnostic settings configuration that ships every verbose log category from every factory to a workspace with a 90-day retention default can quietly become one of the larger lines in the data platform bill. The controls are straightforward: filter diagnostic categories to those you actually query, shorten retention on high-volume verbose categories, use Basic Logs pricing for data you only occasionally search, and archive raw logs to storage for long-term compliance needs at blob rates instead of analytics rates.

The habit that keeps this under control is a monthly review of ingestion by table. The LogsIngestion metric, broken down by resource, shows which factories and which categories dominate. Nine times out of ten the top offender is an activity-run category with verbose payloads that could be summarized at the source or retained for seven days instead of ninety. Cost-aware observability is still observability; it just refuses to pay retail for data it will never read.

Action groups and the automation that keeps humans asleep

An alert without a wired action group is a notification that goes nowhere, and the gap is invisible until the first real incident. Action groups define what happens when an alert fires: email and SMS for humans, webhooks for chat platforms, and automation runbooks for fixes that are known to be safe. The maturity curve starts with everything paging a human, moves to automated restarts for transient failures with humans notified after the fact, and matures into a small set of severity tiers where only novel or high-blast-radius conditions page outside business hours.

Runbooks deserve the same version control as pipeline code. A runbook that restarts a failed ADF pipeline, verifies the rerun succeeded, and escalates if it did not, encodes tribal knowledge in an executable form. Pairing each alert with the runbook that handles it, linked from the alert description, converts the alert from a distress signal into the first step of a documented response, which is exactly what a post-incident review should be able to point to.

Common Mistakes

Assuming detailed pipeline logs flow to Log Analytics automatically

Fix: Configure diagnostic settings per resource at creation time and verify with a test run that the expected categories appear in the workspace

Setting static round-number alert thresholds and never revisiting them

Fix: Derive thresholds from trailing-window percentiles and review them quarterly as traffic grows

Putting every diagnostic category at maximum retention in one workspace

Fix: Tier retention by value: short for verbose activity payloads, longer for audit categories, archive to storage for compliance

Building a single dense workbook for all audiences

Fix: Layer the workbook by audience: golden signals for leadership, failures and errors for on-call, deep diagnostics collapsed by default

Best Practices

  • Enable diagnostic settings through IaC so new resources are observable from their first run
  • Maintain a small library of vetted KQL queries and link them from the alert runbooks
  • Use action groups with automated remediation for known-safe fixes and reserve paging for judgment calls
  • Review Logs Analytics ingestion by table monthly and retire categories nobody queries
  • Export activity logs for audit retention separately from operational logs to keep cost attribution clean

Interview Questions

Q1: How do you set up end-to-end monitoring for a data pipeline?

Configure diagnostic settings on the factory, storage account, and any related services so logs flow to a Log Analytics workspace. Build KQL queries for success rate, duration, and failures. Assemble a workbook layered by audience. Attach alerts with derived thresholds and action groups that include automated remediation where safe, and link every alert to a runbook.

Q2: What is the difference between metrics and logs in Azure Monitor?

Metrics are numerical time series with built-in aggregation and near real-time availability, suited to charts and threshold alerts. Logs are detailed event records queried with KQL, suited to root-cause analysis and audit. The two have different latency and cost profiles, so route each kind of question to the right plane.

Q3: How do you control Log Analytics costs without losing visibility?

Filter diagnostic categories to those you query, tier retention by value, use Basic Logs for high-volume rarely-searched data, and archive compliance data to storage at blob rates. Review the LogsIngestion metric by resource monthly to catch growth before it becomes a surprise.

Key Takeaways

  • Detailed logs only flow where diagnostic settings send them; configure them in IaC or you will discover the gap during an incident
  • Metrics for thresholds and charts, logs for root cause; each has a different cost and latency profile
  • Memorize a handful of operational KQL queries for success rate, slowest activities, and failure clustering
  • Alert thresholds should derive from trailing percentiles and attach to runbooks with automated remediation where safe
  • Log Analytics ingestion and retention are budget lines you can control with category filtering and retention tiering
🔒

Premium Content

Azure Monitor for Data Platforms: KQL, Workbooks, and Alerts

You've previewed the first section. Unlock this full lesson and 900+ advanced tutorials with a Premium plan.

đŸŽ¯End-to-end Projects
đŸ’ŧInterview Prep
📜Certificates
🤝Community Access

Already a member? Log in

CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-13

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Advertisement