buildkite/cloudwatch-metrics-provider
Publish your Buildkite job queue statistics to Cloud Watch for easy EC2 auto-scaling of build agents
460
Publish your Buildkite job queue statistics to AWS Cloud Watch for easy EC2 auto-scaling of your build agents.
The following AWS CloudWatch metrics will be published:
Each metric is also reported with a Project dimension, so you can monitor your build queues on both a global and per-project basis.
Buildkite API Access Token with read_projects
permission.
AWS IAM Policy (e.g. buildkite-cloudwatch-metrics-publisher
) with the following policy document:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1432216114000",
"Effect": "Allow",
"Action": [
"cloudwatch:PutMetricData"
],
"Resource": [
"*"
]
}
]
}
buildkite-cloudwatch-metrics-publisher
) with the above policy attached.Create a buildkite-cloudwatch-metrics-publisher.env
file like below, copying in the credentials of the AWS user, the Buildkite API access token, your AWS region and your Buildkite organization's slug:
BUILDKITE_ORG_SLUG=my-org
BUILDKITE_API_ACCESS_TOKEN=xxx
AWS_ACCESS_KEY_ID=yyy
AWS_SECRET_ACCESS_KEY=zzz
AWS_DEFAULT_REGION=us-east-1
The simplest way is using the official Docker image:
docker run -d \
--name buildkite-cloudwatch-metrics-publisher \
--env-file=buildkite-cloudwatch-metrics-publisher.env \
buildkite/cloudwatch-metrics-provider
To tail the logs:
docker logs -f buildkite-cloudwatch-metrics-publisher
You'll need python ~2.7 installed, and also the pip package manager.
pip install -r requirements.txt
source buildkite-cloudwatch-metrics-publisher.env && \
./buildkite-cloudwatch-metrics-publisher
docker build -t bk-cw-metrics-publisher .
docker run -it \
--rm=true \
--env-file=buildkite-cloudwatch-metrics-publisher.env \
bk-cw-metrics-publisher
See LICENSE.md (MIT)
docker pull buildkite/cloudwatch-metrics-provider