Spinnaker and custom Cloudwatch metrics for scaling policies

505 views Asked by At

I'm currently trying to get around the issue in AWS where CloudWatch alarms cannot contain more than one metric (in this case, SQS message counts).

Scenario:

I have an ASG that contains a set amount of on-demand instances for my application. I have another ASG, where I plan on using spot instances to scale out when it gets busy.

What I'm trying to achieve is, for my application that consumes from 3 SQS queues

  • if at least 1 queue has a message count above the threshold, scale out the spot instances ASG
  • if ALL queues have a message count below the threshold for at least X minutes, scale in

To get around this I'm attempting to publish a custom metric with a count of how many queues have a message count above a certain limit, and then use this metric to decide whether to scale in my auto scaling groups.

However... in Spinnaker, there doesn't seem to be a way to refer to a custom metric (from the UI at least) - I am missing something here or is it just not possible?

From what I understand as well, you can only publish metric data to your own namespaces - attempting to publish to any 'AWS/*' namespace will result in an error?

1

There are 1 answers

1
Chris B On BEST ANSWER

In your settings.js file for deck, include the following block:

providers: {
  aws: {
    // ...
    metrics: {
      customNamespaces: ['yourcustomnamespace'],
    },
    // ...
  }
}

I don't think this is explicitly documented anywhere - you'd have to dig into the source code to find this bit of configuration.