DVA-C02 practice question 32 of 35

A developer is building a microservices-based application by using Python on AWS and several AWS services The developer must use AWS X-Ray The…

Full set: 598 questions

Domain Security

A developer is building a microservices-based application by using Python on AWS and several AWS services The developer must use AWS X-Ray The developer views the service map by using the console to view the service dependencies. During testing, the developer notices that some services are missing from the service map What can the developer do to ensure that all services appear in the X-Ray service map?
Answer options
A: Modify the X-Ray Python agent configuration in each service to increase the sampling rate
B: Instrument the application by using the X-Ray SDK for Python. Install the X-Ray SDK for all the services that the application uses Correct answer
C: Enable X-Ray data aggregation in Amazon CloudWatch Logs for all the services that the application uses
D: Increase the X-Ray service map timeout value in the X-Ray console
Correct Answer:
B. Instrument the application by using the X-Ray SDK for Python. Install the X-Ray SDK for all the services that the application uses
Explanation

The AWS X-Ray service map is generated from trace data submitted by your application's services. For a service to appear on the map, it must be instrumented to generate and send this data (as segments and subsegments) to the X-Ray service. This instrumentation is accomplished by integrating the AWS X-Ray SDK into the application code of each service. If a service is not instrumented, it is invisible to X-Ray because it does not send any trace data. Therefore, to ensure all services are visible, each one must be properly instrumented with the appropriate SDK.

Why Incorrect

A. Increasing the sampling rate only affects how frequently an already instrumented service sends trace data; it cannot make an uninstrumented service appear on the map.
C. Integrating with Amazon CloudWatch Logs is for correlating existing traces with log entries, not for generating the primary trace data required to build the service map.
D. The service map displays nodes based on trace data received within a selected time range; there is no "service map timeout value" that would cause uninstrumented services to appear.

References

1. AWS X-Ray Developer Guide, "Instrumenting your application for AWS X-Ray": "To trace requests that your application serves, you add the X-Ray SDK to your application. The X-Ray SDK sends trace data to X-Ray for requests that are sampled." This establishes that the SDK is the required component for sending trace data.

2. AWS X-Ray Developer Guide, "Using the AWS X-Ray service map": "X-Ray uses the trace data from the requests that your application serves to generate a service map. Each AWS resource that sends data to X-Ray appears as a service in the graph." This confirms the map is built exclusively from trace data sent by services.

3. AWS X-Ray SDK for Python Documentation, "Instrumenting your code": "To instrument your application, first add the aws-xray-sdk library to your application's dependencies. Then, you can use a recorder to instrument your code." This outlines the specific action required, which is installing and using the SDK.

Scroll to Top