{"id":20471785,"url":"https://github.com/signiant/ecs_custom_metrics","last_synced_at":"2025-03-05T13:44:35.304Z","repository":{"id":93380909,"uuid":"80454808","full_name":"Signiant/ecs_custom_metrics","owner":"Signiant","description":null,"archived":false,"fork":false,"pushed_at":"2018-05-24T15:11:35.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-16T02:23:52.116Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/Signiant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-30T19:24:54.000Z","updated_at":"2018-05-24T15:11:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"f288026c-6086-4dd4-86da-ff59030a3624","html_url":"https://github.com/Signiant/ecs_custom_metrics","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/Signiant%2Fecs_custom_metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fecs_custom_metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fecs_custom_metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fecs_custom_metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Signiant","download_url":"https://codeload.github.com/Signiant/ecs_custom_metrics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039536,"owners_count":20061924,"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":[],"created_at":"2024-11-15T14:17:13.932Z","updated_at":"2025-03-05T13:44:35.298Z","avatar_url":"https://github.com/Signiant.png","language":"Python","readme":"# ecs-custom-metrics\nReport Custom ECS Metrics to AWS CloudWatch. The idea is to run a container on an ECS instance in a cluster to report\nthe custom metrics for that cluster.\n\n## Variables\n\n- FREQUENCY - how often to report metrics (defaults to 300 seconds if not specified)\n\n\n## Known Issues\n\nPlease note that FREQUENCY is a bit of a misnomer, it should probably be called DELAY or something similar. In fact what\nhappens is that the scripts are run, then the task sleeps for the duration of FREQUENCY. What that means is that if you\nwanted to run the scripts every minute for instance (FREQUENCY=60), you may end up missing a run every once in a while,\ndepending on how long the script(s) take to run. The solution to this is to use a scheduler (coupled with threading) to\nmake sure the scripts start using the given FREQUENCY.\n\n\n## Example Docker run\n\nThis example runs the metrics collection report scripts (report_task_count_metrics.py and report_scale_down_metric.py)\nevery 60 seconds. The scripts to run are passed in via the -c option. In this case, the two scripts are contained in\nthe docker image, but there is no reason why more scripts couldn't be mounted into the container and run as well (see\nexample 2).\n\nExample 1:\n\n\u003edocker run -d \\\n\u003e -e \"FREQUENCY=60\" \\\n\u003e signiant/ecs_custom_metrics \\\n\u003e -c \"python /report_task_count_metrics.py\" \\\n\u003e -c \"python /report_scale_down_metric.py --cpu 40 --mem 40 --min-cluster-size 1\"\n\nExample 2:\n\n\u003edocker run -d \\\n\u003e -e \"FREQUENCY=60\" \\\n\u003e -v /path/to/additional_script_to_run.sh:/another_report_script.sh \\\n\u003e signiant/ecs_custom_metrics \\\n\u003e -c \"python /report_task_count_metrics.py\" \\\n\u003e -c \"/bin/bash /another_report_script.sh\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fecs_custom_metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigniant%2Fecs_custom_metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fecs_custom_metrics/lists"}