X-Ray Flashcards
(42 cards)
What service provides you with Automated Trace Analysis & Central Service Map Visualization?
X-Ray
What is X-Ray?
AWS X-Ray helps developers analyze and debug production, distributed applications, such as those built using a microservices architecture. With X-Ray, you can understand how your application and its underlying services are performing to identify and troubleshoot the root cause of performance issues and errors. X-Ray provides an end-to-end view of requests as they travel through your application, and shows a map of your application’s underlying components. You can use X-Ray to analyze both applications in development and in production, from simple three-tier applications to complex microservices applications consisting of thousands of services.
What services are compatible with X-Ray?
- AWS Lambda
- Elastic Beanstalk
- ECS
- ELB
- API Gateway
- EC2 Instances or any application server (even on premise)
How can you start using X-Ray in your instances, including on-prem?
Installing the daemon in the instance user data. The daemon is the only option for on-prem
What provides X-Ray for requests?
- Tracing is an end to end way to following a “request”
* Each component dealing with the request adds its own “trace”
What options are provided by X-Ray to trace the requests?
Ability to trace:
o Every request
o Sample request (as a % for example or a rate per minute)
What is X-Ray security?
X-Ray Security:
o IAM for authorization
o KMS for encryption at rest
How can you enable X-Ray?
- Your code (Java, Python, Go, Node.js, .NET) must import the AWS X-Ray SDK
- Install the X-Ray daemon or enable X-Ray AWS Integration
What will your application capture once the AWS X-Ray SDK is imported?
Calls to AWS services
HTTP / HTTPS requests
Database Calls (MySQL, PostgreSQL, DynamoDB)
Queue calls (SQS)
Do you need to perform heavy code modifications to use the AWS X-Ray SDK in your application?
Very little code modification needed
How does work the X-Ray daemon?
X-Ray daemon works as a low level UDP packet interceptor (Linux / Windows / Mac…)
How can you install the X-Ray daemon in your Lambdas?
AWS Lambda / other AWS services already run the X-Ray daemon for you
What must have each application to write data to X-Ray?
Each application must have the IAM rights to write data to X-Ray
What to do if X-Ray is not working on EC2?
o Ensure the EC2 IAM Role has the proper permissions
o Ensure the EC2 instance is running the X-Ray Daemon
What to do to enable X-Ray on AWS Lambda:?
o Ensure it has an IAM execution role with proper policy (AWSX-RayWriteOnlyAccess)
o Ensure that X-Ray is imported in the code
How can you instrument X-Ray in your code?
You can modify your application code to customize and annotation the data that the SDK sends to XRay, using interceptors, filters, handlers, middleware… (ADVANCED)
What is a X-Ray segment?
each application / service will send them
What is a X-Ray sub-segment?
if you need more details in your segment
What is a X-Ray trace?
segments collected together to form an end-to-end trace
What are X-Ray annotations?
Key Value pairs used to index traces and use with filters. Used for searching
What is X-Ray metadata?
Key Value pairs, not indexed, not used for searching
What can you do with X-Ray sampling rules?
With sampling rules, you control the amount of data that you record, reduce cost
What is recorded by the X-Ray SDK by default?
By default, the X-Ray SDK records the first request each second, and five percent of any additional requests
What are in X-Ray the reservoir and the rate?
- One request per second is the reservoir, which ensures that at least one trace is recorded each second as long the service is serving requests.
- Five percent is the rate at which additional requests beyond the reservoir size are sampled