guardian / cdk

Generic Guardian flavoured AWS CDK components
https://guardian.github.io/cdk/
22 stars 5 forks source link

feat(asg): Collect all ASG level metrics #2455

Closed akash1810 closed 1 month ago

akash1810 commented 1 month ago

What does this change?

Extends on https://github.com/guardian/cdk/pull/2255 to collect all ASG level metrics as standard. These metrics should come at no extra cost, at least the docs state:

Group metrics are available at one-minute granularity at no additional charge, but you must enable them. – https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-metrics.html.

UPDATE: After raising an AWS have responded to a support ticket about this:

Amazon EC2 Auto Scaling Group Metrics have no additional charge to enable. They are similar to EC2 basic monitoring metrics, which is also sent for free to Cloudwatch.

Amazon EC2 Auto Scaling fleet management for EC2 instances carries no additional fees. The dynamic scaling capabilities of Amazon EC2 Auto Scaling are enabled by Amazon CloudWatch and also carry no additional fees. Amazon EC2 and Amazon CloudWatch service fees apply and are billed separately.

How to test

See updated snapshots.

How can we measure success?

Group level metrics are useful when understanding service disruption.

Have we considered potential risks?

This change should have no cost impact. If it does, or if you only want a subset, the escape hatch mechanism can be used:

declare const asg: AutoScalingGroup;

const cfnAsg = asg.node.defaultChild as CfnAutoScalingGroup;

cfnAsg.metricsCollection = [
  {
    granularity: "1Minute",
    metrics: [
      // A subset of metrics
    ],
  },
];

Checklist

[^1]: Consider whether this is something that will mean changes to projects that have already been migrated, or to the CDK CLI tool. If changes are required, consider adding a checklist here and/or linking to related PRs. [^2]: If you are adding a new construct or pattern, has new documentation been added? If you are amending defaults or changing behaviour, are the existing docs still valid?

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 43dc653509934a06771bf9118c72563b59a20afb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------- | ----- | | @guardian/cdk | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR