AWS Certified Developer – Associate (DVA-C02) — Question 227
An application uses AWS X-Ray to generate a large amount of trace data on an hourly basis. A developer wants to use filter expressions to limit the returned results through user-specified custom attributes.
How should the developer use filter expressions to filter the results in X-Ray?
Answer options
- A. Add custom attributes as annotations in the segment document.
- B. Add custom attributes as metadata in the segment document.
- C. Add custom attributes as new segment fields in the segment document.
- D. Create new sampling rules that are based on custom attributes.
Correct answer: A
Explanation
The correct answer is A because annotations in AWS X-Ray are indexed and can be used in filter expressions to efficiently query trace data. The other options do not allow for filtering results based on custom attributes; metadata is not indexed, new segment fields are not utilized for filtering, and sampling rules do not directly affect the returned trace data.