A quick post on how create custom CloudWatch Metrics using Python on AWS.
After you produced the metrics into CloudWatch, you will be able to see them when navigating to:
- CloudWatch / Metrics / Custom Namespaces / statusdash/ec2client
When selecting:
1 2 |
|
And should look like this:
The Script:
The python script that will be using boto3 to talk to AWS:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Resources:
https://stackify.com/custom-metrics-aws-lambda/ https://www.syntouch.nl/custom-cloudwatch-metrics-in-python-yes-we-can/ <- psutil https://aws.amazon.com/blogs/devops/new-how-to-better-monitor-your-custom-application-metrics-using-amazon-cloudwatch-agent/ https://medium.com/@mrdoro/aws-lambda-as-the-website-monitoring-tool-184b09202ae2