A developer has a Python application deployed on Amazon ECS with the AWS Fargate launch type. The application is instrumented using the AWS X-Ray SDK for Python, with `patch_all()` invoked at startup. To improve request throughput, the application uses a `ThreadPoolExecutor` from the `concurrent.futures` module to perform downstream HTTP requests using the `requests` library and write operations to Amazon DynamoDB in parallel worker threads. The X-Ray daemon runs as a sidecar container in the ECS task. When analyzing traces in the AWS X-Ray console, the developer observes that downstream HTTP calls and DynamoDB operations executed within the worker threads are not associated with the main request trace, showing up as separate traces or missing entirely. Which of the following actions should the developer take to resolve this tracing correlation issue?
- ASet the environment variable `AWS_XRAY_CONTEXT_MISSING` to `IGNORE_ERROR` in the ECS task definition to allow the X-Ray recorder to automatically link detached threads to the parent execution segment.
- Retrieve the active trace entity in the parent thread using `xray_recorder.get_trace_entity()`, pass this entity to the worker thread, and call `xray_recorder.set_trace_entity(entity)` inside the worker thread before making the downstream calls.Cevap
- CInitialize the AWS SDK clients within the worker threads using hardcoded IAM access keys and secret keys to authenticate the connection to the X-Ray daemon.
- DIncrease the visibility timeout of the input source queue to ensure that worker threads finish executing and have enough time to flush the local segment buffers to the daemon.