Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aws): allow enabledMetrics: [] to enable all metrics #6238

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

dbyron-sf
Copy link
Contributor

when building an auto scaling group. https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_EnableMetricsCollection.html says:

If you specify Granularity and don't specify any metrics, all metrics are enabled.

Before this change

  enabledMetrics: []

in a deploy stage would enable no metrics, like this:

$ aws autoscaling describe-auto-scaling-groups --region=us-west-2 --auto-scaling-group-names=my-asg-v001 | jq .AutoScalingGroups[0].EnabledMetrics
[]

After this PR, we get:

$ aws autoscaling describe-auto-scaling-groups --region=us-west-2 --auto-scaling-group-names=my-asg-v002 | jq .AutoScalingGroups[0].EnabledMetrics
[
  {
    "Metric": "GroupInServiceInstances",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupAndWarmPoolDesiredCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupTerminatingCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "WarmPoolMinSize",
    "Granularity": "1Minute"
  },
  {
    "Metric": "WarmPoolWarmedCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupTotalInstances",
    "Granularity": "1Minute"
  },
  {
    "Metric": "WarmPoolTotalCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupAndWarmPoolTotalCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupDesiredCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupPendingCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupStandbyInstances",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupPendingInstances",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupMinSize",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupStandbyCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupTotalCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "WarmPoolDesiredCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "WarmPoolPendingCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupTerminatingInstances",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupInServiceCapacity",
    "Granularity": "1Minute"
  },
  {
    "Metric": "GroupMaxSize",
    "Granularity": "1Minute"
  },
  {
    "Metric": "WarmPoolTerminatingCapacity",
    "Granularity": "1Minute"
  }
]

when building an auto scaling group.  https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_EnableMetricsCollection.html says:

If you specify Granularity and don't specify any metrics, all metrics are enabled.
@jasonmcintosh
Copy link
Member

enabledMetrics - looks like if NOT set this would be null and disable them. Looking a bit more to see if that's the default or if blank was default (or if deck set a blank kinda thing)

@dbyron-sf
Copy link
Contributor Author

I did a test with no mention of enabledMetrics in the deploy and didn’t get any metrics….The default looks like implicit null here which I think is what does the trick.

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for a merge label Jun 25, 2024
@mergify mergify bot added the auto merged Merged automatically by a bot label Jun 25, 2024
@mergify mergify bot merged commit b8d4033 into spinnaker:master Jun 25, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for a merge target-release/1.35
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants