Serverless Backend with AWS Lambda & API Gateway · 강의

구조화된 로그 기록 및 추적을 통한 관측 가능성

함수가 실제로 수행하는 작업을 확인합니다. 구조화된 JSON 로그 기록, AWS X-Ray를 사용한 분산 추적, 운영 환경 수준의 관측 가능성을 위한 사용자 지정 메트릭을 학습합니다.

레슨 4/413개 단계

구조화된 로그 기록 및 추적을 통한 관측 가능성은(는) CoddyKit의 무료 Serverless Backend with AWS Lambda & API Gateway 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Serverless Backend with AWS Lambda & API Gateway 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Serverless Backend with AWS Lambda & API Gateway 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

The Three Pillars of Observability

Observability rests on logs, metrics, and traces. Together they answer what happened, how much, and where the time went across your serverless system.

Why Structured Logging?

Plain text logs are hard to search. Structured (JSON) logs let CloudWatch Logs Insights filter and aggregate by field, turning logs into queryable data.

Writing a Structured Log

Emit JSON with consistent fields so you can query by request, level, and custom attributes.

console.log(JSON.stringify({
  level: "INFO",
  requestId: context.awsRequestId,
  action: "createOrder",
  orderId: 42
}));

Correlation IDs

Pass a correlation ID through every service and log it everywhere. This lets you trace a single user request across multiple functions and queues.

Querying with Logs Insights

CloudWatch Logs Insights runs SQL-like queries over structured logs.

fields @timestamp, action, orderId
| filter level = "ERROR"
| sort @timestamp desc
| limit 20

Distributed Tracing with X-Ray

AWS X-Ray records a trace as a request flows through Lambda, API Gateway, DynamoDB, and more, showing a timeline of every segment.

Enabling X-Ray

Turn on active tracing for the function, then instrument the SDK so downstream calls become subsegments.

const AWSXRay = require("aws-xray-sdk-core");
const AWS = AWSXRay.captureAWS(require("aws-sdk"));

Custom Subsegments

Wrap your own logic in a subsegment to measure how long a specific block takes inside the trace.

const seg = AWSXRay.getSegment().addNewSubsegment("validate");
validate(input);
seg.close();

Custom Metrics with EMF

The Embedded Metric Format lets you emit metrics inside a structured log line. CloudWatch extracts them automatically — no extra API call.

Setting Alarms

Create CloudWatch alarms on error rate, p99 latency, and DLQ depth. Alarms turn passive metrics into proactive alerts before users notice.

Avoiding Log Noise

Log with intent:

  • Use levels (DEBUG/INFO/ERROR) and a log-level env var
  • Never log secrets or full PII
  • Sample high-volume traces to control cost

Quick Check

Test your observability knowledge.

Recap

You learned production observability:

  • Logs, metrics, and traces are the three pillars
  • Use structured JSON logs and correlation IDs
  • X-Ray gives distributed traces across services
  • Emit custom metrics with EMF and alarm on them
무료로 시작

AI 튜터와 함께 Serverless Backend with AWS Lambda & API Gateway을(를) 배우세요 — 무료

브라우저에서 실제 코드를 작성하고 실행하며, 24/7 AI 튜터로부터 즉각적인 도움을 받고, 웹이나 앱에서 중단한 부분부터 계속 학습하세요.

코스
12
레슨
48

자주 묻는 질문

“구조화된 로그 기록 및 추적을 통한 관측 가능성” 강의는 무료인가요?

네 — “구조화된 로그 기록 및 추적을 통한 관측 가능성” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Serverless Backend with AWS Lambda & API Gateway 강의 전체를 잠금 해제할 수 있습니다. Serverless Backend with AWS Lambda & API Gateway 강의에는 총 4개의 강의가 포함되어 있습니다.

“구조화된 로그 기록 및 추적을 통한 관측 가능성”에서 뭘 배우나요?

함수가 실제로 수행하는 작업을 확인합니다. 구조화된 JSON 로그 기록, AWS X-Ray를 사용한 분산 추적, 운영 환경 수준의 관측 가능성을 위한 사용자 지정 메트릭을 학습합니다. 브라우저에서 직접 실행하는 실습 코드로 Serverless Backend with AWS Lambda & API Gateway을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Serverless Backend with AWS Lambda & API Gateway을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Serverless Backend with AWS Lambda & API Gateway은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.

“구조화된 로그 기록 및 추적을 통한 관측 가능성” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Serverless Backend with AWS Lambda & API Gateway 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Serverless Backend with AWS Lambda & API Gateway 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 콜드 스타트와 웜업 전략
  2. 비용 최적화 기법
  3. 오류 처리와 재시도
  4. 구조화된 로그 기록 및 추적을 통한 관측 가능성
← Serverless Backend with AWS Lambda & API Gateway(으)로 돌아가기