Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update alerts-create-metric-alert-rule.yml #123568

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

azarboon
Copy link
Contributor

@azarboon azarboon commented Jun 28, 2024

Current text only tells about filters, but it should also mention possible scope levels too. Also, I can't find any information on the doc about how does alert work for lower-level resources. For example, if an alert is scoped at subscription level, but the condition is met only at its underlying resource group level, what happens? Does subscription-level alert get triggered? Actually this is a tricky question which is asked in Azure certification exam and I believe the documentation should clearly explain it. I've added it to the best of my knowledge, but feel free to edit / correct it:

"Alerts can be scoped at subscription, resource group and resource level. If you scope at e.g. subscription, its underlying resource groups and resources can trigger the alert."

PS: this and all my PRs follow Microsoft Certification Exam – Candidate Agreement and other relevant NDAs.

Copy link
Contributor

@azarboon : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit ec74c43:

✅ Validation status: passed

File Status Preview URL Details
articles/azure-monitor/alerts/alerts-create-metric-alert-rule.yml ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

PRMerger Results

Issue Description
Yaml File(s) This PR includes changes to .yml file(s) owned by another author.

@Court72
Copy link
Contributor

Court72 commented Jun 28, 2024

@AbbyMSFT

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged tracking label for the PR review team label Jun 28, 2024
@harelbr
Copy link
Contributor

harelbr commented Jul 1, 2024

Metric alerts don't support firing alerts at a subscription or resource group level.
While it's true that for resource types that support multi-resource metric alerts, the scope can be a one or more subscriptions / resource groups / resources, the actual evaluation and the fired alerts are always done at the individual resource level.

@azarboon
Copy link
Contributor Author

azarboon commented Jul 1, 2024

Metric alerts don't support firing alerts at a subscription or resource group level. While it's true that for resource types that support multi-resource metric alerts, the scope can be a one or more subscriptions / resource groups / resources, the actual evaluation and the fired alerts are always done at the individual resource level.

Thanks for your answer. I'm not sure whether we are talking about the same thing but in the portal -> Azure Monitor -> Alert -> Alert rule, I can choose the scope to be subscription, resource group or individual resources:

Here, I've chosen a subscription:
image
image

Here, I've chosen a resource group:
image

@harelbr
Copy link
Contributor

harelbr commented Jul 2, 2024

Today, the UI supports the following scopes:

  • Single resource, resource group, or subscription
  • Multiple resources (of the same type)
  • Multiple resource groups

When using API, there's also an ability to select multiple subscriptions as the scope. We have plans to support this through the UI as well in future releases.

Regardless of the scope defined, the evaluation is always performed on the individual resource level (e.g. the 'Transactions' metric of a Storage Account), or on a dimension combination under the resource (e.g. the 'Transactions' metric of a Storage Account where 'API name' equals 'Get Blobs').

Hope this helps.

@azarboon
Copy link
Contributor Author

azarboon commented Jul 3, 2024

Today, the UI supports the following scopes:

  • Single resource, resource group, or subscription
  • Multiple resources (of the same type)
  • Multiple resource groups

When using API, there's also an ability to select multiple subscriptions as the scope. We have plans to support this through the UI as well in future releases.

Regardless of the scope defined, the evaluation is always performed on the individual resource level (e.g. the 'Transactions' metric of a Storage Account), or on a dimension combination under the resource (e.g. the 'Transactions' metric of a Storage Account where 'API name' equals 'Get Blobs').

Hope this helps.

Thanks for explanation. In the first comment, I brought up a question which is asked in Azure certification exam:

if an alert is scoped at subscription level, but the condition is met only at its underlying resource group level, what happens? Does subscription-level alert get triggered?

Given your explanation, I presume the answer is yes. Alerts get triggered because they are evaluated at individual resource level and it doesn't matter what was scope of the alert (i.e. subscription, resource group or resource). Please correct me if I'm wrong.

Regardless, I believe these explanations and nuances should be clearly explained in the doc. Once you clarify my question, I'll make an edit.

@harelbr
Copy link
Contributor

harelbr commented Jul 3, 2024

In the case described in the certification exam's question, even if the alert rule is defined at the subscription scope, the fired alert will be at the granularity of the offending resource, not the subscription.

I can take this with @AbbyMSFT to clarify this in the doc.
@azarboon - Really appreciate your time and effort investment to help improve our docs!

@azarboon
Copy link
Contributor Author

azarboon commented Jul 3, 2024

In the case described in the certification exam's question, even if the alert rule is defined at the subscription scope, the fired alert will be at the granularity of the offending resource, not the subscription.

I can take this with @AbbyMSFT to clarify this in the doc. @azarboon - Really appreciate your time and effort investment to help improve our docs!

Thank you for clarifying. Also, I (vaguely) remember once I saw a question along similar line: At a higher scope (e.g. subscription level) alert rule was configured to notify admins about some user activity, e.g. if any new user was added, admin gets notified. However, a user related activity happened in a lower scope (e.g. resource group). And question was, whether higher-scope alert gets triggered in such a case? Based on your explanation, I presume the answer is yes (please correct me if I'm wrong).

Honestly, I'm surprised why these nuances and edge cases haven't been already addressed in the doc. But it's my pleasure to help you and community in general.

Edited it according to feedback
@azarboon
Copy link
Contributor Author

azarboon commented Jul 3, 2024

@AbbyMSFT I've edited the PR according to latest info I've received from @harelbr . Can you please tune it further?

Copy link
Contributor

Learn Build status updates of commit 13713e1:

✅ Validation status: passed

File Status Preview URL Details
articles/azure-monitor/alerts/alerts-create-metric-alert-rule.yml ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

PRMerger Results

Issue Description
Yaml File(s) This PR includes changes to .yml file(s) owned by another author.

Copy link
Contributor

Learn Build status updates of commit f0b59a7:

✅ Validation status: passed

File Status Preview URL Details
articles/azure-monitor/alerts/alerts-create-metric-alert-rule.yml ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

PRMerger Results

Issue Description
Yaml File(s) This PR includes changes to .yml file(s) owned by another author.

@azarboon
Copy link
Contributor Author

azarboon commented Jul 5, 2024

@harelbr I just remembered another flavor of this question and I would like to know the answer: Let's say you set alert rules for all administrative operations of e.g. VM at both levels: at resource group and at resource level. If you change your vm, which alerts does get triggered? Only at resource level, at resource group level or both? I guess the answer is both, but can you please confirm it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants