X-Ray Flashcards
Definition of an X-RAY “Trace”
Detailed View of an individual operation
Three use cases for X-RAY “Subsegments”
Downstream calls made by your application to fulfill original request
To generate “inferred” segments on services (like Dynamo) that don’t
create their own segments
To instrument local code / more granular vies into a segment
How do you enable X-Ray on ECS? EKS?
ECS / Fargate: add an X-Ray sidecar to the Task Definition
EKS or K8S: run an X-Ray pod as a “daemon set”
On which port does the X-Ray Daemon listen?
UDP 2000
Why would you favor using “AWS Distro for Open Telemetry” rather than X-Ray?
The former can send your traces to multiple simultaneous backends without code modification – for example, to DataDog, New Relic, X-Ray, etc. The X-Ray SDK can only send to X-Ray – changes would have to be made to the application code.
How is X-Ray implemented differently in ECS vs. EKS?
In ECS (EC2 or Fargate), the X-Ray Daemon is placed in a sidecar container in the task definition
In EKS (EC2) the Daemon is deployed as a Daemon Set. For EKS Fargate, sidecar.
What is the “ResultPath” field in a SF state definition? What does it control?
It controls how the raw input to a state is combined (if at all) with the output to produce a result. The result can be: input only, output only, or input+output
Provide an example of when you might use an X-Ray annotation.
What would you use metadata for?
For an e-commerce platform, you might want to assign each trace to a user category – “guest,” “registered,” “premium.” Then you can filter and find all traces relevant to a certain type of customer.
segment.put_annotation(“user_category”, “premium”)
Metadata can’t be filtered / searched, so it isn’t useful for aggregating information. Instead, detailed information if you need to troubleshoot a certain train. In this example, metadata is capturing the detailed configuration of a recommendation engine:
segment.put_metadata(“recommendation_config”, {
“algorithm”: “collaborative_filtering”,
“version”: “v1.2”,
“weightings”: {
“purchase_history”: 0.8,
“view_history”: 0.2
}
})