X-Ray

AWS X-Ray is a distributed tracing platform that instruments applications and ingests request and response data. It's designed for use in microservices environments.

Concepts

  • Service Maps allow developers to model the structure of the application, allowing for better visualisations of dependencies.
  • They're visualisations of the Service Graph X-Ray assembles from the instrumentation data it gathers.
  • Errors and exceptions raised during execution are collected and raised as part of segments.
  • Segments contain details of the host, client, request, work done, response data and any collected errors.
  • Subsegments provide details on smaller units of work within a segment, e.g. database interactions.
  • Traces track requests as they flow through the application, across services. The tracing data is correlated using the X-Amzn-Trace-Id header.
  • Sampling ensures collected data is representative without collecting everything.
  • Tags on trace data allow filtering the data and improve discoverability.

Integrations

Seamless integrations are provided for AWS services:

SDK

An SDK is available for application-level integration:

  • Java
  • node.js
  • .NET

The SDK provides:

  • Interceptors which trace incoming HTTP requests.
  • Client handlers which instrument client SDKs for other AWS services.
  • An instrumented HTTP client for instrumenting internal and external applications.