microsoft / microsoft/AzureMonitorCommunity

Alert Rule webhookdata incorrect ResultCount value

Open
#174 0 comments 0 reactions 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

Hi, I've been using Alert rules for some time to trigger Teams messages. We process the message using the webhookdata, and evaluate some criteria based on the attribute ResultCount. Ever since the 28th May. the ResultCount has been 2, for all triggered alerts. Regardless of the actual number of results in the webhookdata. This is causing our alert to be broken resulting in messages containing System.Object[] rather than strings.

Partial of the webhookdata to help illustrate, heavily redacted so apologies, just trying to illustrate there are three rows in SearchResults but the ResultCount is 2. I've seen the same ResultCount of 2 where there are 1, 2, 3, 4, 5, 6 rows etc, so it seems ResultCount is broken.

"ResultCount": 2,
"SeverityDescription": "Critical",
"WorkspaceId": "xxxxx-xxxxxx-xxxxx-0aa8889d4e49",
"SearchIntervalDurationMin": "2880",
"AffectedConfigurationItems": [],
"AlertType": "Number of results",
"IncludeSearchResults": true,
"SearchIntervalInMinutes": "2880",
"Threshold": 0,
"Operator": "Greater Than",
"SearchResults": {
"tables": [{
"name": "PrimaryResult",
"columns": [{
"name": "subnet_trim",
"type": "string"
}, {
"name": "Cloud_Identity",
"type": "string"
}, {
"name": "Count",
"type": "long"
}],
"rows": [
["web-plan-investments", "web-QuaiAPI", 8],
["", "paymentsapp", 16],
["", "quaiapp", 42]
]
}],

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 supplied webhookdata example, comparing ResultCount with the number of rows under SearchResults.tables[].rows. No repository file, test, or implementation entry point is identified; the issue is complete only when the alert payload reports the actual result count and downstream message processing no longer receives the incorrect value.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
observability
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.