-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Mark
cloudwatch-hardware-monitoring-cronjob
role as deprecated
Point to using `aws-cloud-watch-agent` instead. Update `aws-cloud-watch-agent` to provide an example configuration file for ease.
- Loading branch information
Showing
2 changed files
with
61 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,56 @@ | ||
# AWS CloudWatch Agent | ||
|
||
This role installs the [AWS Cloud Watch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html). | ||
It is available for Ubuntu Linux running on AMD64 or ARM64 architectures. | ||
|
||
It does not configure or run the agent. | ||
Both of these actions should be performed in the [User Data](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig.html#cfn-as-launchconfig-userdata) made available to EC2 instances. | ||
|
||
By default, this role will create metrics in the namespace `CWAgent`. | ||
It can be customised in [configuration](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html). | ||
|
||
The AWS documentation on CloudWatch Agent is fairly comprehensive, but scattered. | ||
For convenience, some relevant resources are listed below: | ||
|
||
- Creating the Cloud Watch configuration file: | ||
- [Manually](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html) | ||
- [Using the wizard](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-cloudwatch-agent-configuration-file-wizard.html) | ||
- [Running the Cloud Watch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-common-scenarios.html) | ||
|
||
## Example configuration | ||
The following configuration will collect instance memory metrics. The metrics can be aggregated at the ASG level. | ||
|
||
Currently the role does not assume anything about how the agent should be configured, nor does the role run the agent. | ||
Typically both of these actions would be performed in the [User Data](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig.html#cfn-as-launchconfig-userdata) | ||
made available to EC2 instances. | ||
```json | ||
{ | ||
"metrics": { | ||
"append_dimensions": { | ||
"InstanceId": "${aws:InstanceId}", | ||
"AutoScalingGroupName":"${aws:AutoScalingGroupName}" | ||
}, | ||
"aggregation_dimensions": [ | ||
["AutoScalingGroupName"], | ||
[] | ||
], | ||
"metrics_collected": { | ||
"mem": { | ||
"measurement": [ | ||
"available", | ||
"total", | ||
"used" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
At the moment, the role is available for Ubuntu Linux running on AMD64 or ARM64 architectures. | ||
With this being the contents of the file `/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json` on an EC2 instance, we can add the following in the UserData to configure and start the agent: | ||
|
||
The AWS documentation on Cloud Watch agent is fairly comprehensive, but scattered; for convenience, some relevant | ||
resources are listed below: | ||
```bash | ||
amazon-cloudwatch-agent-ctl -a fetch-config -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json | ||
amazon-cloudwatch-agent-ctl -a start | ||
``` | ||
|
||
- creating the Cloud Watch configuration file: | ||
- [manually](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html) | ||
- [using the wizard](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-cloudwatch-agent-configuration-file-wizard.html) | ||
- [running the Cloud Watch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-common-scenarios.html) | ||
|
||
Some example PRs: | ||
- https://github.com/guardian/discussion-modtools/pull/866 | ||
- https://github.com/guardian/deploy-tools-platform/pull/843 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters