{"id":26359088,"url":"https://github.com/assemblyai/drone-queue-cloudwatch","last_synced_at":"2025-03-16T15:58:43.034Z","repository":{"id":37942134,"uuid":"360669262","full_name":"AssemblyAI/drone-queue-cloudwatch","owner":"AssemblyAI","description":"Publish Drone build metrics to Cloudwatch","archived":false,"fork":false,"pushed_at":"2023-01-23T22:03:36.000Z","size":129,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-06-21T17:50:03.987Z","etag":null,"topics":["autoscaling","aws","aws-lambda","cloudwatch","drone","drone-ci","lambda","metrics"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AssemblyAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-22T20:09:10.000Z","updated_at":"2022-11-09T14:35:12.000Z","dependencies_parsed_at":"2023-02-13T03:50:17.886Z","dependency_job_id":null,"html_url":"https://github.com/AssemblyAI/drone-queue-cloudwatch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI%2Fdrone-queue-cloudwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI%2Fdrone-queue-cloudwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI%2Fdrone-queue-cloudwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI%2Fdrone-queue-cloudwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AssemblyAI","download_url":"https://codeload.github.com/AssemblyAI/drone-queue-cloudwatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893859,"owners_count":20364916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autoscaling","aws","aws-lambda","cloudwatch","drone","drone-ci","lambda","metrics"],"created_at":"2025-03-16T15:58:42.255Z","updated_at":"2025-03-16T15:58:43.024Z","avatar_url":"https://github.com/AssemblyAI.png","language":"Go","readme":"# drone-queue-cloudwatch\n\n## Overview\n\n`drone-queue-cloudwatch` is a Lambda function that publishes queued Drone builds to Cloudwatch Metrics. Metric dimensions are built from the node labels specified by a given build.\n\nThis tool allows you to leverage AWS autoscaling across multiple Drone worker groups. Some of our CI workloads need to run on GPU instances, others don't.\n\n## Usage\n\n### Drone\n\nIn order for the code to actually publish metrics, you must use [node routing](https://docs.drone.io/pipeline/docker/syntax/routing/).\n\nWhen `drone-queue-cloudwatch` inspects builds, it uses the node labels to build the Cloudwatch metrics dimensions.\n\n### Lambda\n\nThis is meant to be run as a cron job.\n\nSee the `terraform/` directory for reference.\n\nThe zip artifact is accessible in the `aai-oss` S3 bucket in us-west-2\n- To use a specific version of the code, use the `drone-queue-cloudwatch/\u003ccommit sha\u003e.zip` object key\n- To use the latest version, use the `drone-queue-cloudwatch/latest.zip` object key\n\n## Autoscaling\n\n**Note:** You want to use the \"Sum\" statistic when configuring autoscaling. You should also treat missing data as \"Not Breaching\"\n\nThis application assumes each Drone worker group passes the same `DRONE_RUNNER_LABELS` to all workers.\n\nFor example, one group would have these labels:\n\n- `class=standard`\n- `os=linux`\n\nAnd another these:\n\n- `class=gpu`\n- `os=linux`\n\nYour Drone file would specify either\n\n```yml\nnode:\n  os: linux\n  class: gpu\n```\n\nor \n\n```yml\nnode:\n  os: linux\n  class: standard\n```\n\nYour autoscaling trigger would launch more instances / containers for a given worker group based on how many queued builds there are.\n\nTo prevent scale in events from disrupting running builds, use a metrics expression to ensure you don't scale down too far if there are running builds.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemblyai%2Fdrone-queue-cloudwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassemblyai%2Fdrone-queue-cloudwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemblyai%2Fdrone-queue-cloudwatch/lists"}