AWS Certified DevOps Engineer – ProfessionalMonitoring and LoggingEasy

A DevOps team is deploying a new serverless application using AWS Lambda functions and Amazon API Gateway. They need to ensure that detailed performance metrics and trace data are collected for all invocations to monitor application health and troubleshoot issues. The solution must be easy to implement and minimize overhead for the Lambda functions.

  1. AEnable AWS X-Ray active tracing for Lambda functions and API Gateway stages.
  2. BEnable CloudWatch Logs for Lambda and configure custom metrics using Embedded Metric Format (EMF).
  3. CImplement custom Python/Node.js scripts within each Lambda function to push metrics to CloudWatch and traces to a custom backend.
  4. DUse CloudWatch Container Insights to monitor the performance of Lambda functions.
Show answer & explanation

Correct answer: A. Enable AWS X-Ray active tracing for Lambda functions and API Gateway stages.

AWS X-Ray active tracing for Lambda and API Gateway automatically collects detailed trace data, performance metrics, and service maps for each request. It provides end-to-end visibility across the serverless application, making it easy to identify bottlenecks and troubleshoot issues with minimal implementation effort.

Why the other options are wrong

  • B. EMF is for custom metrics, but X-Ray is specifically for detailed trace data and performance metrics across distributed services.
  • C. Custom scripts are high overhead, complex to maintain, and reinvent functionality already provided by X-Ray.
  • D. Container Insights is for containerized applications (ECS, EKS), not directly for Lambda functions.

AWS X-Ray Active Tracing for Lambda/API Gateway

Enabling X-Ray active tracing for Lambda functions and API Gateway stages automatically collects detailed trace information for requests.

  • Provides end-to-end visibility for serverless applications.
  • Captures request segments, subsegments, and metadata.
  • Generates service maps to visualize connections and latency.
  • Minimal configuration required in Lambda and API Gateway settings.

Memory trick: X-Ray's 'Active Trace' is the easy button for Lambda insights.

More Monitoring and Logging questions