Q15 — AWS DVA-C02 Ch.3
Question 15 of 100 | ← Chapter 3
An application generates a large volume of trace data using AWS X-Ray. The developer wants to filter returned results using custom attributes specified by users. How should the developer use X-Ray filter expressions to filter results?
- A. Add the custom attribute as an annotation in the segment document. ✓
- B. Add the custom attribute as metadata in the segment document.
- C. Add the custom attribute as a new segment field in the segment document.
- D. Create a new sampling rule based on the custom attribute.
Correct Answer: A. Add the custom attribute as an annotation in the segment document.
Explanation
X-Ray allows filtering traces using filter expressions only on annotations and attributes explicitly added to segments. Annotations are indexed and queryable in filter expressions; metadata is not. Custom attributes must therefore be added as annotations (option A) to enable effective filtering. Sampling rules (option D) affect trace collection—not result filtering—and adding fields (option C) is not supported.