Monitor workload - Azure portal

This article describes how to use the Azure portal to monitor your workload. This includes setting up Azure Monitor Logs to investigate query execution and workload trends using log analytics for Azure SQL Data Warehouse.

Prerequisites

  • Azure subscription: If you don't have an Azure subscription, create a free account before you begin.
  • Azure SQL Data Warehouse: We will be collecting logs for a SQL Data Warehouse. If you don't have a SQL Data Warehouse provisioned, see the instructions in Create a SQL Data Warehouse.

Create a Log Analytics workspace

Navigate to the browse blade for Log Analytics workspaces and create a workspace

Log Analytics workspaces

Add Analytics workspace

Add Analytics workspace

For more details on workspaces, visit the following documentation.

Turn on Diagnostic logs

Configure diagnostic settings to emit logs from your SQL Data Warehouse. Logs consist of telemetry views of your data warehouse equivalent to the most commonly used performance troubleshooting DMVs for SQL Data Warehouse. Currently the following views are supported:

Enabling diagnostic logs

Logs can be emitted to Azure Storage, Stream Analytics, or Log Analytics. For this tutorial, select Log Analytics.

Specify logs

Run queries against Log Analytics

Navigate to your Log Analytics workspace where you can do the following:

  • Analyze logs using log queries and save queries for reuse
  • Save queries for reuse
  • Create log alerts
  • Pin query results to a dashboard

For details on the capabilities of log queries, visit the following documentation.

Log Analytics workspace editor

Log Analytics workspace queries

Sample log queries

//List all queries 
AzureDiagnostics
| where Category contains "ExecRequests"
| project TimeGenerated, StartTime_t, EndTime_t, Status_s, Command_s, ResourceClass_s, duration=datetime_diff('millisecond',EndTime_t, StartTime_t)
//Chart the most active resource classes
AzureDiagnostics
| where Category contains "ExecRequests"
| where Status_s == "Completed"
| summarize totalQueries = dcount(RequestId_s) by ResourceClass_s
| render barchart 
//Count of all queued queries
AzureDiagnostics
| where Category contains "waits" 
| where Type_s == "UserConcurrencyResourceType"
| summarize totalQueuedQueries = dcount(RequestId_s)

Next steps

Now that you have set up and configured Azure monitor logs, customize Azure dashboards to share across your team.