scaleOnMetric does not allow to change periods/datapoints to alarm
See original GitHub issueHi , how to change the defaults alarms created with autoscaling module for scaleOnMetric ? It sets datapoints to 1 and period to 60s. I tried this but it does not work (shows no changes):
scaling = autoscalinggroup.scale_on_metric(
f'ScaleToNrMessInQueue-{stage}-{app_name}-{version}',
metric=queue.metric("ApproximateNumberOfMessagesVisible"),
scaling_steps=[
autoscaling.ScalingInterval(upper=0, change=0),
autoscaling.ScalingInterval(lower=0, upper=1, change=1),
autoscaling.ScalingInterval(lower=2, upper=3, change=2),
autoscaling.ScalingInterval(lower=3, change=3)
],
adjustment_type=autoscaling.AdjustmentType.EXACT_CAPACITY
)
scaling.lower_alarm.datapoints_to_alarm = 5
scaling.lower_alarm.evaluation_periods = 5
scaling.lower_alarm.period = core.Duration.minutes(5)
I see one such property hardcoded here https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts#L110
Environment
- CDK CLI Version: 1.19.0 (build 5597bbe)
- Module Version: latest/master
- OS: Windows 7
- Language: Python
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Using Amazon CloudWatch alarms - AWS Documentation
In the following figure, the alarm threshold for a metric alarm is set to three units. Both Evaluation Period and Datapoints to Alarm...
Read more >awslabs/aws-cdk - Gitter
Hi , how to change the defaults alarms created with autoscaling module for scaleOnMetric ? It sents datapoints to 1 and period to...
Read more >@aws-cdk/aws-applicationautoscaling - npm
The AutoScaling construct library will create the required CloudWatch alarms and AutoScaling policies for you. Scaling based on multiple ...
Read more >CloudWatch — Boto3 Docs 1.26.37 documentation
If ignore , the alarm state does not change during periods with too few data points to be statistically significant. If evaluate or...
Read more >AWS Cloudwatch Alarm Setup Tutorial | Step by Step - YouTube
AWS Cloudwatch Alarms are an important tool to get notified in case your application starts experiencing issues. This can range from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@toleabivol,
Wouldn’t you be able to achieve this by setting grace on the health_check property of the
autoscalinggroup
to allow warm up time? see CloudFormation docs.You can add it to the
autoscalinggroup
:Generally, to override the
lower_alarm
properties you need to use escape hatches which will allow you to override the defined alarm properties:This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.