The X-Ray service receives inbound and outbound trace data that is collected from your applications.
X-Ray traces create a service map to give you a visual reference of the workflow and identify latency and performance issues, as shown in Figure 5.11.
X-Ray aggregates the collected trace information and metadata by installing the AWS daemon instrumentation code on the application servers to collect the information. The services do not export the data directly into the X-Ray service, but rather the client SDK exports the files to a collector that buffers the trace data from the clients and then uploads the data in its queue to the X-Ray service as a batch operation. The daemon is preinstalled in Lambda and Elastic Beanstalk and can be installed on Linux, macOS, and Windows platforms.
X-Ray collects the trace data and generates a detailed service map of the correlated traces. The map displays a complete path from the client to the application and its backend services. Bottlenecks and latency graphing allow you to identify and resolve performance issues. Developers can use X-Ray to look into their distributed applications and debug issues between microservices.
X-Ray will analyze the collected trace data and help to locate performance issues in your applications. It will assign these to root causes. Insights are created when the fault rates are out of normal operations, and the insight can be tracked through to resolution. This is a continuous background process that X-Ray is running.
FIGURE 5.11 X-Ray workflow map
X-Ray Insights analyzes the data generated by the AWS X-Ray service, identifies anomalies, and generates notifications on what the anomaly is and why it was triggered. The service can be helpful in determining a root cause of a performance issue based on the trace data generated by the insights and can provide data on its impact to your operations. This is extremely helpful when troubleshooting distributed applications as it allows you to view the dependencies and responses between the microservices. It identifies other services and applications that may be affected by the issue so you can get a complete view of systems impacted and how it may be affecting users. The timeline view is helpful in determining when the issue began and how it has progressed over a definable timeline.
The service uses a statistical analysis to learn trends about your collected trace data. A band of acceptable values is calculated, and alerts are generated when trends exceed the baseline metrics. The alerts include information on the root service, other services that are affected, and any user impacts. A timeline is added with critical events listed along that timeline. The notifications can be posted to the AWS EventBridge service that allows you to forward the X-Ray Insights generated alerts to any AWS or external application for remediation or logging.
X-Ray is available in the CloudWatch console.