Giter Club home page Giter Club logo

nomad-autoscaler-cloudwatch-apm's Introduction

Nomad Autoscaler CloudWatch APM

A Nomad Autoscaler APM plugin to scale Nomad jobs using CloudWatch Metrics.

This software is in early development and should be used with caution.

Feedback and contributions are welcome :-)

Plugin Configuration

To use the plugin you will need to download the binary to the client nodes and add the following block into the Nomad Autoscaler configuration.

If the aws_access_key_id and aws_secret_access_key settings are omitted the plugin will use the instance role to authenticate with the CloudWatch API.

The IAM user or role requires the cloudwatch:GetMetricData permission.

apm "cloudwatch" {
  driver = "nomad-autoscaler-cloudwatch-apm"

  config = {
    aws_region            = "us-east-1"
    aws_access_key_id     = "<AWS_ACCESS_KEY_ID>"
    aws_secret_access_key = "<AWS_SECRET_ACCESS_KEY>"
  }
}

Policy Configuration

To scale a job with CloudWatch Metrics add the following block to your scaling policy. The query string is passed directly to the CloudWatch metrics API. Further details on the query syntax can be found in the CloudWatch documentation.

check "cloudwatch" {
  source = "cloudwatch"
  query  = <<-QUERY
    SELECT MAX(ApproximateNumberOfMessagesVisible) FROM SCHEMA("AWS/SQS", QueueName) WHERE QueueName = '<QUEUE_NAME>'
  QUERY

  strategy "target-value" {
    target = 50
  }
}

Example

A Vagrant box with a working demo of the CloudWatch APM plugin has been provided in the example folder.

nomad-autoscaler-cloudwatch-apm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

obourdon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.