From e77a4a597bed893bf1a2e44e3893d917c702d46662248d67c6607bcb138487ab Mon Sep 17 00:00:00 2001 From: Rijndael Date: Tue, 27 Oct 2026 00:52:17 +0000 Subject: [PATCH] X-ray --- X-Ray/_X-Ray.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/X-Ray/_X-Ray.md b/X-Ray/_X-Ray.md index a401d74..e248432 100644 --- a/X-Ray/_X-Ray.md +++ b/X-Ray/_X-Ray.md @@ -1,3 +1,80 @@ # X-Ray -AWS X-Ray is a AWS Managed service for diagnosing issues in a microservice architecture. The main idea is that you pass headers in your calls, AWS picks up on those headers and looks at the propagation of the requests across bits of AWS. +AWS [[_X-Ray|X-Ray]] is a AWS Managed service for diagnosing issues (performance and failures) in a microservice architecture. The main idea is that you pass headers in your calls, AWS picks up on those headers and looks at the propagation of the requests across bits of AWS. + +It's a distributed tracing system. + +## Anatomy of X-Ray + +```mermaid +flowchart LR + API["X-Ray API"] --> Console["X-Ray Console"] + Daemon["X-Ray Daemon"] --> API + SDK["X-Ray SDK"] --> Daemon + Other["Other Clients:\nAWS SDK or AWS CLI"] --> API + Other --> Daemon + API --> Other + +``` + +## X-Ray SDK +- The SDK provides **interceptors** to trace HTTP requests +- **Client handlers** to **instrument** AWS SDK clients that your application uses to call other AWS Services +- A HTTP Client to use to instrument calls to other internal and external HTTP web services + +## X-Ray Instrumentation +Measure he level of product's performance to diagnose errors and write trace information. + +## X-Ray-Daemon +It buffers segments into a queue and uploads in batches. +It's available to be installed on Linux, Windows, Mac +Comes with [[_Elastic BeanStalk]] and [[_Lambda]] by default. + +## X-Ray Concepts +* **Segments**: + * Details about the host (IP address/kind of host). + * Request information. + * The time/duration. + * Errors and Faults. + * Response Statuses. + +* **Subsegments**: + * More granular timing information. + * Can contain calls to other AWS services + +* **Service Graph**: + * Just the UI graph in the Console. + +* **Traces**: + * A Trace ID is the path of a request through your application. + * Gets passed along to everything else, so that it can be tracked. + * Not every trace gets recorded. + +* **Sampling**: + * [[_X-Ray|AWS X-Ray]] uses a sampling algorithm to determine which requests get traced. + * Default is: + * The first request each second... + * And 5% of any additional requests. + * Idea is to reduce service charges when you are getting started. The default sampling rate is low. + * You can create limits for the rates + +* **Tracing Header**: + * All requests are traced up to a configurable minimum. + * After that minimum, a percentage of requests are traced to avoid unnecessary cost. (See above) + * [The sampling decision and the trace ID are added to HTTP requests in tracing headers named `X-Amzn-Trace-Id`.]{.underline} + * The Tracing Header determines if the trace shows up in the viewer. + +* **Filter Expressions**: + * Applications make a lot of data, you can filter it + +* **Groups**: + * Named Filter Expressions. + * Groups only update after you update them, the data before still remains (subsequent traces only) + +* **Annotations and Metadata**: + * + +* **Errors, Faults, and Exceptions**: + * + +