Which steps will gather the trace information with the LEAST amount of changes and performance impacts to the application?
Add additional logging to the application code. Use the Amazon CloudWatch agent to stream the application logs into Amazon OpenSearch Service. Query the log data in OpenSearch Service.
Instrument the application to use the AWS X-Ray SDK. Post trace data to an Amazon OpenSearch Service cluster. Query the trace data for calls to the HTTP client and the MySQL client.
On the AWS Elastic Beanstalk management page for the application, enable the AWS X-Ray daemon. View the trace data in the X-Ray console.
Instrument the application using the AWS X-Ray SDK. On the AWS Elastic Beanstalk management page for the application, enable the X-Ray daemon. View the trace data in the X-Ray console.
Explanations:
Adding additional logging to the application code may help diagnose issues but is not the most efficient method. Using CloudWatch to stream logs to OpenSearch Service requires significant code changes and does not provide trace data specifically for identifying latency issues, especially with third-party API calls and RDS queries.
While instrumenting the application with the AWS X-Ray SDK would help collect trace data for diagnosing latency issues, posting trace data to OpenSearch Service adds unnecessary complexity and performance overhead. It is not the least invasive solution as it involves code changes and additional configuration.
Enabling the AWS X-Ray daemon directly on the Elastic Beanstalk management page would collect trace data without needing significant code changes, but it lacks instrumentation with the X-Ray SDK. This means it will not capture detailed traces for specific calls to the HTTP client and MySQL client.
Instrumenting the application with the AWS X-Ray SDK allows for detailed tracing of requests and queries, while enabling the X-Ray daemon on Elastic Beanstalk provides a streamlined setup. This option captures trace data efficiently with minimal changes to the application and directly addresses the latency issues for both the HTTP client and MySQL queries.