Reputation: 3363
Using Grafana's CloudWatch data source and a little InfluxDB magic, I can pull many metrics from my live environment; like CPU utilisation, memory utilisation, host count, thread count, ect etc.
These metrics will make more sense if I can spot the moments of live deployments on that graph.ELB Health Host Count metric kinda helps but does not show deployments, rather shows auto scale activities.
I can't find any metrics in AWS CloudWatch adapter for CodeDeploy. Dooes anybody has a way of doing this?
(My Env: Sprint Boot app on Docker containers deployed on AWS Fargate using CodeDeploy)
Upvotes: 0
Views: 422
Reputation: 8890
You can push datapoints into a CloudWatch metric using the "put-metric-data" aws cli call [1]. You can call this command from the AppSpec file hooks like BeforeInstall and AfterInstall. Make sure the EC2 instance role has the requisite permissions.
[1] https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/put-metric-data.html
Upvotes: 0