Skip to content

Commit dcb2c8f

Browse files
committed
sample schemas
1 parent b0eb639 commit dcb2c8f

File tree

1 file changed

+184
-2
lines changed

1 file changed

+184
-2
lines changed

articles/azure-monitor/autoscale/autoscale-diagnostics.md

Lines changed: 184 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ ms.topic: how-to
99
ms.date: 06/22/2022
1010
ms.reviewer: akkumari
1111

12-
# Customer intent: As a dev opps admin I want to collect and analyze autoscale metrics and logs
12+
# Customer intent: As a devops admin, I want to collect and analyze autoscale metrics and logs.
1313
---
1414

1515
>>> Where is the flapping logs ?
1616
1717

1818
# Diagnostic settings in Autoscale
1919

20-
Autoscale has two log categories and a set of metrics which can be enabled via the **Diagnostics settings** tab on the autoscale settings page.
20+
Autoscale has two log categories and a set of metrics which can be enabled via the **Diagnostics settings** tab on the autoscale setting page.
21+
22+
:::image type="content" source="./media/autoscale-diagnostics/autoscale-diagnostics-menu.png" alt-text="A screenshot showing the menu in the autoscale setting page":::
23+
2124

2225
The two categories are
2326
* [Autoscale Evaluations](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/autoscaleevaluationslog) containing log data relating to rule evaluation.
@@ -246,4 +249,183 @@ Recorded at different intervals of an instance scale action.
246249
}
247250
```
248251

252+
## Activity Logs
253+
The follwoing events are logged to the Activity log with CategoryValue =="Autoscale".
254+
255+
* Autoscale scale up initiated
256+
* Autoscale scale up completed
257+
* Autoscale scale down initiated
258+
* Autoscale scale down completed
259+
* Predictive Autoscale scale up initiated
260+
* Predictive Autoscale scale up completed
261+
* Metric Failure
262+
* Metric Recovery
263+
* Predictive Metric Failure
264+
* Flapping
265+
266+
An extract of each log event name, showing the relevant parts of the `Propertes` element are shown below:
267+
268+
### Autoscale action
269+
270+
Logged when autoscale attempts to scale in or out.
271+
272+
```json
273+
{
274+
"eventCategory": "Autoscale",
275+
"eventName": "AutoscaleAction",
276+
...
277+
"eventProperties": "{
278+
"Description": "The autoscale engine attempting to scale resource '/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/ resourcegroups/ed-rg-001/providers/Microsoft.Web/serverFarms/ScaleableAppServicePlan' from 2 instances count to 1 instances count.",
279+
"ResourceName": "/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourcegroups/ed-rg-001/providers/Microsoft.Web/ serverFarms/ScaleableAppServicePlan",
280+
"OldInstancesCount": 2,
281+
"NewInstancesCount": 1,
282+
"ActiveAutoscaleProfile": {
283+
"Name": "Default scale condition",
284+
"Capacity": {
285+
"Minimum": "1",
286+
"Maximum": "5",
287+
"Default": "1"
288+
},
289+
"Rules": [
290+
{
291+
"MetricTrigger": {
292+
"Name": "CpuPercentage",
293+
"Namespace": "microsoft.web/serverfarms",
294+
"Resource": "/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourceGroups/ed-rg-001/providers/Microsoft. Web/serverFarms/ScaleableAppServicePlan",
295+
"ResourceLocation": "West Central US",
296+
"TimeGrain": "PT1M",
297+
"Statistic": "Average",
298+
"TimeWindow": "PT2M",
299+
"TimeAggregation": "Average",
300+
"Operator": "GreaterThan",
301+
"Threshold": 40.0,
302+
"Source": "/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourceGroups/ed-rg-001/providers/Microsoft. Web/serverFarms/ScaleableAppServicePlan",
303+
"MetricType": "MDM",
304+
"Dimensions": [],
305+
"DividePerInstance": false
306+
},
307+
"ScaleAction": {
308+
"Direction": "Increase",
309+
"Type": "ChangeCount",
310+
"Value": "1",
311+
"Cooldown": "PT3M"
312+
}
313+
},
314+
{
315+
"MetricTrigger": {
316+
"Name": "CpuPercentage",
317+
"Namespace": "microsoft.web/serverfarms",
318+
"Resource": "/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourceGroups/ed-rg-001/providers/Microsoft. Web/serverFarms/ScaleableAppServicePlan",
319+
"ResourceLocation": "West Central US",
320+
"TimeGrain": "PT1M",
321+
"Statistic": "Average",
322+
"TimeWindow": "PT5M",
323+
"TimeAggregation": "Average",
324+
"Operator": "LessThanOrEqual",
325+
"Threshold": 30.0,
326+
"Source": "/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourceGroups/ed-rg-001/providers/Microsoft. Web/serverFarms/ScaleableAppServicePlan",
327+
"MetricType": "MDM",
328+
"Dimensions": [],
329+
"DividePerInstance": false
330+
},
331+
"ScaleAction": {
332+
"Direction": "Decrease",
333+
"Type": "ExactCount",
334+
"Value": "1",
335+
"Cooldown": "PT5M"
336+
}
337+
}
338+
]
339+
},
340+
"LastScaleActionTime": "Thu, 26 Jan 2023 12:57:14 GMT"
341+
}",
342+
...
343+
"activityStatusValue": "Succeeded"
344+
}
345+
346+
```
347+
348+
### Get Operation Status Result
349+
350+
Logged following an scale event.
351+
352+
```json
353+
354+
"Properties":{
355+
"eventCategory": "Autoscale",
356+
"eventName": "GetOperationStatusResult",
357+
...
358+
"eventProperties": "{\"OldInstancesCount\":3,\"NewInstancesCount\":2}",
359+
...
360+
"activityStatusValue": "Succeeded"
361+
}
249362

363+
```
364+
365+
### Metric failure
366+
367+
Logged when autoscale cannot determine the value of the metric used in the scale rule.
368+
369+
```JSON
370+
"Properties":{
371+
"eventCategory": "Autoscale",
372+
"eventName": "MetricFailure",
373+
...
374+
"eventProperties": "{\"Notes\":\"To ensure service availability, Autoscale will scale out the resource to the default capacity if it is greater than the current capacity\"}",
375+
...
376+
"activityStatusValue": "Failed"
377+
}
378+
```
379+
### Metric recovery
380+
381+
Logged when autoscale can once again determine the value of the metric used in the scale rule after a `MetricFailure` event
382+
383+
```json
384+
"Properties":{
385+
"eventCategory": "Autoscale",
386+
"eventName": "MetricRecovery",
387+
...
388+
"eventProperties": "{}",
389+
...
390+
"activityStatusValue": "Succeeded"
391+
}
392+
```
393+
### Predictive Metric Failure
394+
395+
Logged when autoscale can not calculate a predicted scale events due to the metric being unavailable.
396+
397+
```json
398+
"Properties":{
399+
"eventCategory": "Autoscale",
400+
"eventName": "PredictiveMetricFailure",
401+
...
402+
"eventProperties": "{\"Notes\":\"To ensure service availability, Autoscale will scale out the resource to the default capacity if it is greater than the current capacity\"}",
403+
...
404+
"activityStatusValue": "Failed"
405+
}
406+
```
407+
### Flapping Occurred
408+
409+
Logged when autoscale detects a flapping and scales differently to avoid it.
410+
411+
```JSON
412+
"Properties":{
413+
"eventCategory": "Autoscale",
414+
"eventName": "FlappingOccurred",
415+
...
416+
"eventProperties":
417+
"{"Description":"Scale down will occur with updated instance count to avoid flapping.
418+
Resource: '/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourcegroups/rg-001/providers/Microsoft.Web/serverFarms/ ScaleableAppServicePlan'.
419+
Current instance count: '6',
420+
Intended new instance count: '1'.
421+
Actual new instance count: '4'",
422+
"ResourceName":"/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourcegroups/rg-001/providers/Microsoft.Web/serverFarms/ ScaleableAppServicePlan",
423+
"OldInstancesCount":6,
424+
"NewInstancesCount":4,
425+
"ActiveAutoscaleProfile":{"Name":"Auto created scale condition",
426+
"Capacity":{"Minimum":"1","Maximum":"30","Default":"1"},
427+
"Rules":[{"MetricTrigger":{"Name":"Requests","Namespace":"microsoft.web/sites","Resource":"/subscriptions/ d1234567-9876-a1b2-a2b1-123a567b9f8767/resourceGroups/rg-001/providers/Microsoft.Web/sites/ScaleableWebApp1", "ResourceLocation":"West Central US","TimeGrain":"PT1M","Statistic":"Average","TimeWindow":"PT1M","TimeAggregation":"Maximum", "Operator":"GreaterThanOrEqual","Threshold":3.0,"Source":"/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourceGroups/ rg-001/providers/Microsoft.Web/sites/ScaleableWebApp1","MetricType":"MDM","Dimensions":[],"DividePerInstance":true}, "ScaleAction":{"Direction":"Increase","Type":"ChangeCount","Value":"10","Cooldown":"PT1M"}},{"MetricTrigger":{"Name":"Requests", "Namespace":"microsoft.web/sites","Resource":"/subscriptions/d1234567-9876-a1b2-a2b1-123a567b9f8767/resourceGroups/rg-001/ providers/Microsoft.Web/sites/ScaleableWebApp1","ResourceLocation":"West Central US","TimeGrain":"PT1M","Statistic":"Max", "TimeWindow":"PT1M","TimeAggregation":"Maximum","Operator":"LessThan","Threshold":3.0,"Source":"/subscriptions/ d1234567-9876-a1b2-a2b1-123a567b9f8767/resourceGroups/rg-001/providers/Microsoft.Web/sites/ScaleableWebApp1","MetricType":"MDM", "Dimensions":[],"DividePerInstance":true},"ScaleAction":{"Direction":"Decrease","Type":"ChangeCount","Value":"5", "Cooldown":"PT1M"}}]}}",
428+
...
429+
"activityStatusValue": "Succeeded"
430+
}
431+
```

0 commit comments

Comments
 (0)