A developer has enabled active tracing on an AWS Lambda function. The function calls an external web service using a standard HTTP client library. In the AWS X-Ray console, the trace map displays the Lambda function execution segment, but the downstream HTTP calls to the external web service are missing from the trace. What should the developer do to include the downstream HTTP calls in the X-Ray trace map?
- Instrument the HTTP client library inside the application code using the AWS X-Ray SDK.Cevap
- BEnable Active Tracing on the Lambda function, which automatically instruments all downstream HTTP calls without requiring code modifications.
- CConfigure the HTTP client to include hardcoded AWS IAM credentials with X-Ray write permissions in the request headers.
- DIncrease the Lambda function's timeout configuration so that the execution environment has enough time to flush the trace data to X-Ray.
Cevap
Instrument the HTTP client library inside the application code using the AWS X-Ray SDK.
To trace downstream HTTP calls, the developer must instrument the HTTP client library using the AWS X-Ray SDK. This instrumentation dynamically injects the X-Ray tracing header into outbound requests, allowing downstream services to participate in the trace.
Adım Adım Çözüm
Anahtar Kavram
AWS X-Ray Downstream Context Propagation and HTTP Client Instrumentation
Tahmini Süre:45s