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

[azure-mgmt-monitor] Support for Metric Alerts #2670

Closed
prburgu opened this issue May 31, 2018 · 5 comments
Closed

[azure-mgmt-monitor] Support for Metric Alerts #2670

prburgu opened this issue May 31, 2018 · 5 comments

Comments

@prburgu
Copy link

prburgu commented May 31, 2018

Azure now has next generation metric alerts and the REST API is documented at https://docs.microsoft.com/en-us/rest/api/monitor/metricalerts
It would be good to have SDK support for this. Is it in the works?

@lmazuel
Copy link
Member

lmazuel commented May 31, 2018

Hi @prburgu
Yes! You can try to preview client from this PR:
#2460

@prburgu
Copy link
Author

prburgu commented Jun 6, 2018

The preview client from the PR works great. I could successfully create alerts and received e-mail alerts. One issue I noticed is that, I could not edit those alerts from Azure Portal. Clicking on the alert in link Portal is giving broken cloud. May be an issue with Portal handling the alerts created through API.

@lmazuel
Copy link
Member

lmazuel commented Jun 8, 2018

Hi @prburgu
I'm closing your issue since it's a portal issue, but I forward your message to the Monitor team.
Thanks!

@lmazuel lmazuel closed this as completed Jun 8, 2018
@lmazuel
Copy link
Member

lmazuel commented Jun 12, 2018

@prburgu Could you share what you sent? Just for testing purposes. Thanks!

@prburgu
Copy link
Author

prburgu commented Jun 21, 2018

Here is the request/response.

2018-06-21T14:02:58-0700 - msrest.http_logger (MainThread) - DEBUG: Request URL: 'https://management.azure.com/subscriptions/<sbucription_id>/resourceGroups/dev1-resourcegroup/providers/Microsoft.Insights/metricAlerts/dev1-backend-lb-pool-availability?api-version=2018-03-01'
2018-06-21T14:02:58-0700 - msrest.http_logger (MainThread) - DEBUG: Request method: 'PUT'
2018-06-21T14:02:58-0700 - msrest.http_logger (MainThread) - DEBUG: Request body:
2018-06-21T14:02:58-0700 - msrest.http_logger (MainThread) - DEBUG: {"properties": {"criteria": {"allOf": [{"threshold": 70.0, "timeAggregation": "Average", "operator": "LessThan", "metricName": "DipAvailability", "name": "DipAvailability"}], "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"}, "severity": 2, "autoMitigate": true, "actions": [{"actionGroupId": "/subscriptions/<subscription_id>/resourceGroups/dev1-resourcegroup/providers/microsoft.insights/actionGroups/dev1-alerts1"}, {"actionGroupId": "/subscriptions/<subscription_id>/resourceGroups/dev1-resourcegroup/providers/microsoft.insights/actionGroups/dev1-alerts2"}], "enabled": true, "description": "dev1-backend-lb-pool-availability", "evaluationFrequency": "PT5M", "windowSize": "PT5M", "scopes": ["/subscriptions/<subscription_id>/resourceGroups/dev1-resourcegroup/providers/Microsoft.Network/loadBalancers/dev1-backend-lb"]}, "location": "global"}
2018-06-21T14:02:58-0700 - msrest.http_logger (MainThread) - DEBUG: Response status: 200
2018-06-21T14:02:58-0700 - msrest.http_logger (MainThread) - DEBUG: Response content:
2018-06-21T14:02:58-0700 - msrest.http_logger (MainThread) - DEBUG: b'{\r\n  "location": "global",\r\n  "type": "Microsoft.Insights/metricAlerts",\r\n  "name": "dev1-backend-lb-pool-availability",\r\n  "id": "/subscriptions/<subscription_id>/resourceGroups/dev1-resourcegroup/providers/Microsoft.Insights/metricAlerts/dev1-backend-lb-pool-availability",\r\n  "properties": {\r\n    "description": "dev1-backend-lb-pool-availability",\r\n    "severity": 2,\r\n    "enabled": true,\r\n    "scopes": [\r\n      "/subscriptions/<subscription_id>/resourceGroups/dev1-resourcegroup/providers/Microsoft.Network/loadBalancers/dev1-backend-lb"\r\n    ],\r\n    "evaluationFrequency": "PT5M",\r\n    "windowSize": "PT5M",\r\n    "templateType": 8,\r\n    "criteria": {\r\n      "allOf": [\r\n        {\r\n          "name": "DipAvailability",\r\n          "metricNamespace": "microsoft.network/loadbalancers",\r\n          "metricName": "DipAvailability",\r\n          "operator": "LessThan",\r\n          "threshold": 70.0,\r\n          "timeAggregation": "Average"\r\n        }\r\n      ],\r\n      "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"\r\n    },\r\n    "actions": [\r\n      {\r\n        "actionGroupId": "/subscriptions/<subscription_id>/resourceGroups/dev1-resourcegroup/providers/microsoft.insights/actionGroups/olm-dev1-alerts1"\r\n      },\r\n      {\r\n        "actionGroupId": "/subscriptions/<subscription_id>/resourceGroups/dev1-resourcegroup/providers/microsoft.insights/actionGroups/dev1-alerts2"\r\n      }\r\n    ]\r\n  }\r\n}'

@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants