microsoft / microsoft/AzureMonitorCommunity

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

Open
#207 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1.2k
Forks
493
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Wait stats query shown in issue #207 and verify the AzureDiagnostics fields returned for the selected time range and SQL resources. Compare those fields with the summarize expression, then confirm the corrected query runs without the unresolved wait_type_s error and produces wait statistics grouped by logical server and database.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, databases, observability-sre
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.