{"id":21322040,"url":"https://github.com/advantageous/metricsd","last_synced_at":"2025-07-12T05:30:46.186Z","repository":{"id":61626723,"uuid":"76320175","full_name":"advantageous/metricsd","owner":"advantageous","description":"Metrics daemon to collect OS metrics and send results to AWS CloudWatch Metrics","archived":false,"fork":false,"pushed_at":"2017-03-19T20:41:27.000Z","size":7274,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-20T11:48:01.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/advantageous.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-13T03:46:03.000Z","updated_at":"2017-07-06T22:55:46.000Z","dependencies_parsed_at":"2022-10-18T17:30:33.562Z","dependency_job_id":null,"html_url":"https://github.com/advantageous/metricsd","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fmetricsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fmetricsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fmetricsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fmetricsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/advantageous","download_url":"https://codeload.github.com/advantageous/metricsd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225795302,"owners_count":17525317,"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-21T20:12:53.786Z","updated_at":"2024-11-21T20:12:55.234Z","avatar_url":"https://github.com/advantageous.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Metricsd\n\nReads OS metrics and sends data to AWS CloudWatch Metrics.\n \nMetricsd gathers OS metrics for AWS CloudWatch. You can install it as a systemd process. \n\nConfiguration\n####  /etc/metricsd.conf \n```conf\n\n\n# AWS Region         string        `hcl:\"aws_region\"`\n# If not set, uses aws current region for this instance.\n# Used for testing only.\n# aws_region = \"us-west-1\"\n\n# EC2InstanceId     string        `hcl:\"ec2_instance_id\"`\n# If not set, uses aws instance id for this instance\n# Used for testing only.\n# ec2_instance_id = \"i-my-fake-instanceid\"\n\n# Debug             bool          `hcl:\"debug\"`\n# Used for testing and debugging\ndebug = false\n\n# Local             bool          `hcl:\"local\"`\n# Used to ingore local ec2 meta-data, used for development only.\n# local = true\n\n# TimePeriodSeconds time.Duration `hcl:\"interval_seconds\"`\n# Defaults to 30 seconds, how often metrics are collected.\ninterval_seconds = 10\n\n# Used to specify the environment: prod, dev, qa, staging, etc.\n# This gets used as a dimension that is sent to cloudwatch. \nenv=\"dev\"\n\n# Used to specify the top level namespace in cloudwatch.\nnamespace=\"Cassandra Cluster\"\n\n# Used to specify the role of the AMI instance.\n# Gets used as a dimension.\n# e.g., dcos-master, consul-master, dcos-agent, cassandra-node, etc.\nserver_role=\"dcos-master\"\n\n\n``` \n\n\n## Installing as a service\n\nIf you are using systemd you should install this as a service. \n\n#### /etc/systemd/system/metricsd.service\n```conf\n\n[Unit]\nDescription=metricsd\nWants=basic.target\nAfter=basic.target network.target\n\n[Service]\nUser=centos\nGroup=centos\nExecStart=/usr/bin/metricsd\nKillMode=process\nRestart=on-failure\nRestartSec=42s\n\n\n[Install]\nWantedBy=multi-user.target\n\n\n```\nCopy the binary to `/usr/bin/metricsd`.\nCopy the config to `/etc/metricsd.conf`.\nYou can specify a different conf location by using `/usr/bin/metricsd -conf /foo/bar/myconf.conf`.\n\n#### Installing \n```sh\n\n$ sudo cp metricsd_linux /usr/bin/metricsd \n$ sudo systemctl stop  metricsd.service\n$ sudo systemctl enable  metricsd.service\n$ sudo systemctl start  metricsd.service\n$ sudo systemctl status  metricsd.service\n● metricsd.service - metricsd\n   Loaded: loaded (/etc/systemd/system/metricsd.service; enabled; vendor preset: disabled)\n   Active: active (running) since Wed 2016-12-21 20:19:59 UTC; 8s ago\n Main PID: 718 (metricsd)\n   CGroup: /system.slice/metricsd.service\n           └─718 /usr/bin/metricsd\n\nDec 21 20:19:59 ip-172-31-29-173 systemd[1]: Started metricsd.\nDec 21 20:19:59 ip-172-31-29-173 systemd[1]: Starting metricsd...\nDec 21 20:19:59 ip-172-31-29-173 metricsd[718]: INFO     : [main] - 2016/12/21 20:19:59 config.go:29: Loading config /et....conf\nDec 21 20:19:59 ip-172-31-29-173 metricsd[718]: INFO     : [main] - 2016/12/21 20:19:59 config.go:45: Loading log...\n```\n\nThere are full example packer install scripts under bin/packer/packer_ec2.json.\nThe best doc is a working example. \n\n## Metrics\n\n### CPU metrics\n* `softIrqCnt` - count of soft interrupts for the last period\n* `intrCnt` - count of interrupts for the last period\n* `ctxtCnt` - count of context switches for the last period\n* `processesStrtCnt` - count of processes started for the last period\n* `GuestJif` - jiffies spent in guest mode for last time period\n* `UsrJif` - jiffies spent in usr mode for last time period\n* `IdleJif` - jiffies spent in usr mode for last time period\n* `IowaitJif` - jiffies spent handling IO for last time period\n* `IrqJif` - jiffies spent handling interrupts for last time period\n* `GuestniceJif` - guest nice mode\n* `StealJif` - time stolen by noisy neighbors for last time period\n* `SysJif` - jiffies spent doing OS stuff like system calls in last time period\n* `SoftIrqJif` - jiffies spent handling soft IRQs in the last time period\n* `procsRunning` - count of processes currently running\n* `procsBlocked` - count of processes currently blocked (could be for IO or just waiting to get CPU time)\n\n\n### Disk metrics\n* `dUVol\u003cVOLUME_NAME\u003eAvailPer` - percentage of disk space left (per volume)\n\n### Mem metrics\n* `mFreeLvl` - free memory in kilobytes\n* `mUsedLvl` - used memory in kilobytes\n* `mSharedLvl` - shared memory in kilobytes\n* `mBufLvl` - memory used by IO buffers in kilobytes\n* `mAvailableLvl` - memory available in kilobytes\n* `mFreePer` - percentage of memory free\n* `mUsedPer` - percentage of memory used\n\nIf swapping is enabled (which is unlikely), then you will get the above with `mSwpX` instead of `mX`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Fmetricsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadvantageous%2Fmetricsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Fmetricsd/lists"}