brunch

389. Serverless 점검법

by Master Seo
1 arch.png

<> 목표

Serverless 서비스가 제대로 동작하지 않을때 점검법

이미지를 올려 APIGW, 람다를 거쳐 S3에 업로드 되고 SNS로 통보되는 구성

AWS X-Ray 사용법 , Cloud Watch 사용법 알아보자.


구성

Client -----APIGW --- 람다 -----S3 업로드 --- SNS


<0> cloudwatch arn 확인

<1> 사용중인 API Gateway, Lambda 서비스 확인

<2> API Gateway에서 cloudwatch logs, x-ray 활성화 하기

<3> 데이터 올리기

<4> 오류 검사



<0> cloudwatch arn 확인

arn:aws:iam::15xxxxxxxxxxx 확인



<1> 사용중인 API Gateway, Lambda 서비스 확인


1

서비스 > API Gateway


2

서비스 > Step function


3

서비스 > lambda

필터 상자


4

서비스 > Dynamodb

Item


5

서비스 > S3


6

서비스 > Cloudwatch > 로그 그룹 > 로그 스트림


7

서비스 > x-ray




<2> API Gateway에서 Cloudwatch logs, x-ray 활성화 하기


1. API Gateway 에 cloudwatch log와 x-ray 활성화


service > API Gateway > 해당 API 클릭 > stages > dev > logs/tracing >enable cloudwatch logs > log level : info

enable X-Ray tracing

save change


api gateway 하단 > 설정 > ARN

cloudwatchLogRoleArn

복사

setting

cloudwatch log role ARN




2 람다에서 X-Ray 활성화 하기


Service > Lambda > filter 에서 LambdaAddAlbum 로 필터링 > lambda > AWS X-Ray : active tracing 체크

save


3

service > s3 > 버킷 확인



<3> 데이터 올리기

services > s3 에 이미지 올라와 있는지 확인



<4> 오류 검사


S3 버킷에 이미지가 안 올라가 있는 경우 ?? 결과가 안나오는 경우


1 api gateway 문제 점검법 ?


serviec > xray > service map 검사

serices > API Gateway 검사

serices > cloudwatch 검사



2. lambda function timeouts 문제 점검 ?

serviec > xray > 해당 lambda > 추적 보기 > 로그 그룹 보기> 이벤트 필터에

timed out 확인



감사합니다.

keyword
매거진의 이전글388. CloudWatch,SNS,Slack알람받기