CloudWatch
Ref:
- App ELB metrics list - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudwatch-metrics.html
- Network ELB metrics list - https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-cloudwatch-metrics.html
- RDS metrics list - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-metrics.html
- Step Function metrics list - https://docs.aws.amazon.com/step-functions/latest/dg/procedure-cw-metrics.html
Log filtering
In log group, filtering:
Excluding
In log insight, query:
Contains string
Alarm
Guide to create an alarm for HTTP code 5xx
- CloudWatch → Alarm
- Choose from a metric under a namespace, e.g.
HTTPCode_Target_5XX_Count
underAWS/ApplicationELB
for a specific ALB - Select
Statistic
toSum
Period
set to 1 minute- Conditions →
Greater
than0
- Notification → alarm trigger if the state is
In alarm
(i.e. meet the condition above) - Select / Create a SNS topic
Send Alarm to Slack (Without lambda)
Assume you already made an Alarm
We will use AWS ChatBot to do integration with Slack easily
-
Go to IAM → Policy → Create new
- It is used as *Channel guardrail policies*
- Normally we allow the minimum action, put these inside Statements:
-
AWS ChatBot → create new → slack
- You will be prompted to allow AWS to access Slack
-
After creation →
configure Slack Channel
- You can get the
Channel ID
from slack channel -
Permission
→Channel IAM role
- create a new one, with (default)
Notification permission
- the permission will be like below
- create a new one, with (default)
-
Channel guardrail policies
→ choose the policy we created above Notification
→ choose the region and Topic (that is created while creating Alarm)
- You can get the