Lambda Monitoring & X-Ray Tracing

Logging and Monitoring

Tracing with X-Ray

  • Enable in Lambda configuration (Active Tracing)
  • Don't need to runs X-Ray daemon since Lambda does it for you
  • Remember to use the X-Ray SDK and ensure that you have the correct Lambda Execution Role (IAM Role) to write to Xray
    • managed policy: AWSXrayDaemonWriteAccess
  • Environment variables to communicate with X-Ray
    • _X_AMZN_TRACE_ID : contains tracing headers
    • AWS_XRAY_CONTEXT_MISSING: default set to LOG_ERROR to prevent throwing exception
    • AWS_XRAY_DAEMON_ADDRESS: the X-Ray daemon IP_ADDRESS:PORT