feat(cloudwatch): support single-series alarm warm-up - #38744
Open
topra-aws wants to merge 3 commits into
Open
Conversation
Expose WarmUpConfiguration through Alarm, PromQLAlarm, and metric alarm factories. Validate the supported 1-2880 minute range while preserving the existing default behavior when the option is omitted.
Remove warm-up configuration from PromQL and anomaly detection alarm props. Reject math and search expression alarms at synthesis so the option is limited to a single Metric.
Allow warm-up for single-output metric math, collapsed Metrics Insights queries, and anomaly detection. Reject direct Metrics Insights GROUP BY contributor alarms while keeping PromQL excluded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue # (if applicable)
Closes #38743.
Reason for this change
CloudFormation supports delaying CloudWatch alarm evaluation after an alarm is created or updated, which helps prevent alarm noise while a resource begins publishing metric data. The generated
CfnAlarmexposes this capability, but the existing alarm L2 APIs require users to reach through to the L1 construct.Warm-up configuration is supported for alarms that evaluate one time series, including ordinary metric math, collapsed Metrics Insights queries, and anomaly detection. It is not supported for PromQL contributor alarms or direct multi-time-series Metrics Insights queries.
Description of changes
AlarmWarmupConfigurationwith a strongly typedDurationand the option to wait for the complete warm-up period.warmupConfigurationthroughAlarm,AnomalyDetectionAlarm,Metric.createAlarm, andMathExpression.createAlarm.GROUP BY, and grouped Metrics Insights queries collapsed by an outer metric math expression.SELECT ... GROUP BYcontributor alarm when warm-up is configured.PromQLAlarmProps.WarmUpConfigurationproperty and validate CloudFormation's 1–2880 whole-minute range while preserving unresolved tokens.Generated L1 files such as
cloudwatch.generated.tsare intentionally ignored and regenerated byspec2cdk; they must not be committed manually. The pinned@aws-cdk/aws-service-spec0.1.208 generates bothCfnAlarm.WarmUpConfigurationPropertyandCfnAlarmProps.warmUpConfiguration. The temporary F3002 acknowledgement is for the separate CloudFormation validation schema, which currently lags the L1 service spec.Describe any new or updated permissions being added
None.
Description of how you validated changes
@aws-cdk/aws-service-specresolved to the pinned 0.1.208.aws-cdk-libsuccessfully twice after the final changes; jsii reported 0 errors and 0 warnings.aws-cdk-liblint command successfully; only pre-existing repository warnings were reported.integ.alarm-warmupin dry-run mode; the snapshot was unchanged and passed.git diff --checksuccessfully.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license