DOP-C02 Question 207
Select 3Your team manages a high-traffic web application hosted on Amazon ECS with tasks running on Fargate. To troubleshoot intermittent performance issues, you are tasked with setting up centralized logging and metrics collection for better visibility. The solution must ensure logs and metrics are stored securely and are easily searchable. How should you configure this setup?
- A
Enable AWS Fargate logging to send container logs to Amazon CloudWatch Logs, and configure log groups with retention policies.
- B
Set up Amazon CloudWatch Container Insights to collect performance metrics and resource utilization from ECS tasks.
- C
Directly configure the ECS task definitions to send logs to an S3 bucket for long-term storage.
- D
Use an Amazon Kinesis Data Firehose to forward logs from CloudWatch Logs to Amazon S3 for archival and query purposes.
- E
Deploy third-party logging agents on each container to stream logs to an external logging solution like Elasticsearch.
Show answer and explanation
Correct answers: A, B, D
Explanation
The correct solution involves using AWS native services to ensure easy integration, security, and scalability. Fargate logging to CloudWatch Logs allows centralized log collection, while Container Insights provides granular metrics. Kinesis Data Firehose can be used to forward logs to S3 for archival and querying. Directly logging to S3 from ECS task definitions or using unsupported third-party agents is not suitable in this scenario.
- A. Correct.
This is correct because AWS Fargate logging can be easily configured to forward logs to Amazon CloudWatch Logs, where they can be managed using log groups and retention policies.
- B. Correct.
This is correct because Amazon CloudWatch Container Insights provides detailed performance metrics and resource utilization data, which is crucial for debugging and monitoring ECS tasks.
- C. Incorrect.
While S3 can be a good option for long-term storage, sending logs directly from ECS task definitions to S3 is not supported. Logs must first be sent to a service like CloudWatch Logs for further processing.
- D. Correct.
This is correct because Amazon Kinesis Data Firehose can be used to deliver logs from CloudWatch Logs to S3 for long-term storage and analysis, ensuring logs are securely archived and queryable.
- E. Incorrect.
This is incorrect because deploying third-party logging agents on AWS Fargate containers is not supported. AWS-native tools like CloudWatch Logs are preferred for such tasks in a managed environment.