通过此操作,我们可以为自定义指标配置维度。
{
"metrics":{
"append_dimensions":{
"AutoScalingGroupName":"${!aws:AutoScalingGroupName}",
"ImageId":"${!aws:ImageId}",
"InstanceId":"${!aws:InstanceId}",
"InstanceType":"${!aws:InstanceType}"
},
"metrics_collected":{
"mem":{
"measurement":[
"mem_used_percent"
]
},
"swap":{
"measurement":[
"swap_used_percent"
]
}
}
}
}
现在,我尝试为尺寸自动缩放组创建警报:
MemoryAlarmHigh:
Type: AWS::CloudWatch::Alarm
Properties:
EvaluationPeriods: '1'
Statistic: Average
Threshold: '70'
AlarmDescription: Go in Alarm is memory is higher than 70% for 60 seconds
Period: '60'
AlarmActions:
- Ref: ScaleUpPolicy
Namespace: CWAgent
Dimensions:
- Name: AutoScalingGroupName
Value: !Ref ASG
ComparisonOperator: GreaterThanThreshold
MetricName: xxx
这不起作用。我没有足够的数据。 现在,当我使用
{
"metrics": {
"append_dimensions": {
"AutoScalingGroupName": "${!aws:AutoScalingGroupName}"
},
"metrics_collected": {
"mem": {
"measurement": [
"mem_used_percent"
]
}
}
}
}
并且警报现在起作用。但是我想使用多个维度,但要分别使用它们(例如在EC2名称空间中),以便使用警报。
我该怎么做?
答案 0 :(得分:1)
尝试设置cd /env/Lib/site-packages/
ls
Directory: C:<path/to/site-packages>
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- <today's date> numpy
d----- <today's date> numpy-1.16.4.dist-info
。
赞:
aggregation_dimensions