AWS X-Ray のアイコン

AWS X-Ray Specialized2017年〜

Trace requests through distributed applications and identify performance bottlenecks

What It Does

AWS X-Ray traces requests end-to-end through distributed applications. It visualizes the flow of requests through API Gateway, Lambda, ECS, EC2, and more, identifying latency bottlenecks and error locations. The service map provides a visual overview of your entire application architecture and dependencies.

Use Cases

Performance analysis of microservice architectures, investigating Lambda cold starts and timeouts, identifying root causes of API latency issues, and pinpointing services with high error rates.

Everyday Analogy

Think of a package tracking system. Every time a package (request) passes through a warehouse (service), it's logged with a tracking number (trace ID), letting you trace where delays occurred or where a package was lost (error).

What Is X-Ray?

AWS X-Ray is a distributed tracing service. Integrate the X-Ray SDK into your application or enable tracing in Lambda and API Gateway settings, and each request gets a trace ID with processing times recorded at each service. The service map shows call relationships between services, average latency, and error rates at a glance.

Traces and Segments

An X-Ray trace is the complete record of a single request passing through all services. Processing at each service is recorded as a segment, with external API calls and DB queries recorded as detailed subsegments. The trace timeline view lets you visually identify which service and which operation is taking the most time. Sampling rules control trace collection volume to manage costs. To deepen your understanding of traces and segments, reference books on Amazon are a helpful resource.

Getting Started

For Lambda functions, simply enable "Active tracing" in the function settings to start X-Ray tracing. For EC2 or ECS, install the X-Ray daemon and integrate the X-Ray SDK into your application. View service maps and traces in the X-Ray traces section of the CloudWatch console.

Things to Watch Out For

  • Pay-per-use based on traces recorded and scanned. Use sampling rules to control collection volume and manage costs
  • X-Ray integrates with CloudWatch - view service maps and traces from CloudWatch ServiceLens
共有するXB!