microsoft / AzureMonitorCommunity

An open repo for Azure Monitor queries, workbooks, alerts and more
MIT License
1.02k stars 441 forks source link

Wait Stats (database) query is busted - 'summarize' operator: Failed to resolve scalar expression named 'wait_type_s' #207

Open mbourgon opened 8 months ago

mbourgon commented 8 months ago

The below query throws an error that it failed to resolve wait_type_s. I don't see it in the list of returned fields.

// Wait stats 
// Wait stats over the last hour, by Logical Server and Database. 
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.SQL"
| where TimeGenerated >= ago(60min)
| parse _ResourceId with * "/microsoft.sql/servers/" LogicalServerName "/databases/" DatabaseName
| summarize Total_count_60mins = sum(delta_waiting_tasks_count_d) by LogicalServerName, DatabaseName, wait_type_s