0

I can create basic auto sacle rule such as memory easily

az monitor autoscale rule create -g xx --autoscale-name xxxx --scale out 2 --condition "CpuPercentage > 60 avg 1m" 

But I want to create a rule base on Http Queue Length or Http5xx error, then az monitor command throws error

az monitor autoscale rule create -g xx --autoscale-name xxxx --scale out 2 --condition "HttpQueueLength <= 1 sum 1m" 

az monitor autoscale rule create -g xx --autoscale-name xxxx --scale out 2 --condition "Http5xx <= 50 sum 1m" 

         

Error is:

--condition ["NAMESPACE"] METRIC {==,!=,>,>=,<,<=} THRESHOLD {avg,min,max,total,count} PERIOD
            [where DIMENSION {==,!=} VALUE [or VALUE ...]
            [and   DIMENSION {==,!=} VALUE [or VALUE ...] ...]]

Can someone guide me?

Ecstasy
  • 1,866
  • 1
  • 9
  • 17
daxu
  • 3,514
  • 5
  • 38
  • 76
  • I just realised that azure cli doesn't support sum in condition (Only support count, min, max, avg, total). What is the difference between sum, count and total? – daxu Aug 11 '21 at 10:43

1 Answers1

0

Sum – the sum of all values captured over the aggregation interval. Sometimes referred to as the Total aggregation.

Count – the number of measurements captured over the aggregation interval. Count doesn't look at the value of the measurement, only the number of records.

Total tends to refer to the total for a given criteria (total requests, total jobs, etc.)

Refer supported metrics link , and Explained metrics for further more information.