{"id":709,"date":"2024-08-15T23:19:36","date_gmt":"2024-08-15T23:19:36","guid":{"rendered":"https:\/\/draith.com\/?p=709"},"modified":"2025-03-17T23:32:11","modified_gmt":"2025-03-17T23:32:11","slug":"private-preview-dynamic-log-alerts","status":"publish","type":"post","link":"https:\/\/draith.com\/?p=709","title":{"rendered":"Private Preview &#8211; Dynamic Log Alerts!"},"content":{"rendered":"\n<p>Let&#8217;s face it\u2014manually setting alert thresholds in Azure Monitor can feel like trying to hit a moving target while blindfolded. Just when you think you&#8217;ve nailed the perfect threshold, your application&#8217;s behavior decides to take a detour, leaving you drowning in false positives or, worse, missing critical alerts. Azure Monitor&#8217;s dynamic thresholds for log search alerts are here to save the day!<\/p>\n\n\n\n<p><strong>Why Dynamic Thresholds Are a Game-Changer<\/strong><\/p>\n\n\n\n<p>Dynamic thresholds in Azure Monitor analyze historical data to establish expected performance patterns, automatically adjusting alert thresholds as your application&#8217;s behavior changes.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automatic Calibration &#8211; Say goodbye to manual tuning. Dynamic thresholds adjust themselves based on your system&#8217;s historical data<\/li>\n\n\n\n<li>Intelligent Learning &#8211; By understanding patterns and trends\u2014be it daily spikes or weekly lulls\u2014dynamic thresholds adapt to your application&#8217;s changing situations.<\/li>\n\n\n\n<li>Scalable Alerts &#8211; Dynamic thresholds allow for a single alert rule to handle multiple dimensions, defining specific alert bands for each combination.<\/li>\n<\/ul>\n\n\n\n<p>It&#8217;s still in Private Preview (boo!), but it won&#8217;t be long before we get our hands on it in public preview!<\/p>\n\n\n\n<p>So what does it look like?  Here is a sample ARM template that sets a dynamic threshold on CPU percentage &#8211; notice the new criterionType of DynamicThresholdCriterion.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"$schema\": \"https:\/\/schema.management.azure.com\/schemas\/2019-04-01\/deploymentTemplate.json#\",\n  \"contentVersion\": \"1.0.0.0\",\n  \"parameters\": {\n    \"scheduledqueryrules_PerfDemoRule_name\": {\n      \"defaultValue\": \"PerfDemoRule\",\n      \"type\": \"String\"\n    },\n    \"workspaces_PerfDemoWorkspace_externalid\": {\n      \"defaultValue\": \"\/subscriptions\/XXXX-XXXX-XXXX-XXXX\/resourceGroups\/XXXX\/providers\/Microsoft.OperationalInsights\/workspaces\/PerfDemoWorkspace\",\n      \"type\": \"String\"\n    }\n  },\n  \"resources\": &#91;\n    {\n      \"type\": \"microsoft.insights\/scheduledqueryrules\",\n      \"apiVersion\": \"2024-01-01-preview\",\n      \"name\": \"&#91;parameters('scheduledqueryrules_PerfDemoRule_name')]\",\n      \"location\": \"eastus2\",\n      \"properties\": {\n        \"displayName\": \"&#91;parameters('scheduledqueryrules_PerfDemoRule_name')]\",\n        \"severity\": 3,\n        \"enabled\": true,\n        \"evaluationFrequency\": \"PT5M\",\n        \"scopes\": &#91;\n          \"&#91;parameters('workspaces_PerfDemoWorkspace_externalid')]\"\n        ],\n        \"targetResourceTypes\": &#91;\n          \"Microsoft.Compute\/virtualMachines\"\n        ],\n        \"criteria\": {\n          \"allOf\": &#91;\n            {\n              \"criterionType\": \"DynamicThresholdCriterion\",\n              \"metricName\": \"Percentage CPU\",\n              \"timeAggregation\": \"Average\",\n              \"dimensions\": &#91;\n                {\n                  \"name\": \"Computer\",\n                  \"operator\": \"Include\",\n                  \"values\": &#91; \"*\" ]\n                }\n              ],\n              \"alertSensitivity\": \"Medium\"\n            }\n          ]\n        }\n      }\n    }\n  ]\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s face it\u2014manually setting alert thresholds in Azure Monitor can feel like trying to hit a moving target while blindfolded. Just when you think you&#8217;ve nailed the perfect threshold, your application&#8217;s behavior decides to take a detour, leaving you drowning in false positives or, worse, missing critical alerts. Azure Monitor&#8217;s dynamic thresholds for log search &hellip; <a href=\"https:\/\/draith.com\/?p=709\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Private Preview &#8211; Dynamic Log Alerts!&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4,27],"class_list":["post-709","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-azure","tag-azure-monitor"],"_links":{"self":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts\/709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=709"}],"version-history":[{"count":1,"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts\/709\/revisions"}],"predecessor-version":[{"id":710,"href":"https:\/\/draith.com\/index.php?rest_route=\/wp\/v2\/posts\/709\/revisions\/710"}],"wp:attachment":[{"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draith.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}