North-Seattle-College / ad440-winter2021-thursday-repo

NSC AD 440 Winter 2021 Thursday cohort practicum repo
Apache License 2.0
2 stars 27 forks source link

Create Alerts for error 500 generated by the /user/{user_id}/tasks #267

Closed jinudean closed 3 years ago

jinudean commented 3 years ago

get email alerts from AWS when more than 10 errors 500 within 5mins

jinudean commented 3 years ago

first of all, I need to create clone lambda function to trigger alarm fro 500 error

jinudean commented 3 years ago

I created "Status code" but i could not count error on metric graph

jinudean commented 3 years ago

"Status code : 500" is not on message section of log

jinudean commented 3 years ago

Create Error Lambda function of HttpTriggerApiUsersUseridTasks then confirmed Error count on function monitor on metric Error metric

jinudean commented 3 years ago

review filter syntax document from AWS https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html

jinudean commented 3 years ago

Click View logs in "ClouldWatch" Screen Shot 2021-03-17 at 9 44 06 PM

jinudean commented 3 years ago

click "metric filters"

Screen Shot 2021-03-17 at 9 45 53 PM

Create metric filter

Screen Shot 2021-03-17 at 9 48 20 PM

Type into filter pattern "ERROR 500"

test pattern with log which one has "ERROR 500"

click Test pattern and confirmed filter working with log event the click next

fill out create filter name

review and create

jinudean commented 3 years ago

confirm metric filter was created then check box right upper corner

confirm "create alarm" is clickable

new window open

Screen Shot 2021-03-17 at 9 57 34 PM

enter " 10 " trashhold value then next

select Create new topic then enter topic name and enter email address

Screen Shot 2021-03-17 at 10 00 07 PM

next page show up "Alarm name" and "Alarm description"

Screen Shot 2021-03-17 at 10 03 33 PM

jinudean commented 3 years ago

Test going back to function test page then create error least 11 times to create alarm

confirmed Error create and it hit alarm. Alarm show up action triggered

Screen Shot 2021-03-18 at 7 33 08 PM

jinudean commented 3 years ago

Confirm email SNS notice from AWS

Screen Shot 2021-03-18 at 7 10 42 PM

jinudean commented 3 years ago
Date Activity Time Spent
03/11/21 Research AWS alarm clould watch 2 hrs
03/12/21 Research AWS Document 2 hrs
03/13/21 Research AWS metric filter 2 hrs
03/16/21 Filter pattern make for [ERROR] 4 hrs
03/18/21 ReCreated alarm with "ERROR 500 " filter pattern 1 hrs
yergu commented 3 years ago

Hi Jin, I reviewed your work , Everything looks Looks Fine, Good Job!