DOP-C02 Monitoring and Logging Practice Question
A company is using Amazon RDS for MySQL and needs to monitor the number of slow queries. They have enabled slow query logs. How can they effectively monitor and alert on the number of slow queries per minute?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Publish slow query logs to CloudWatch Logs, create a metric filter, and set an alarm.
Slow query logs from RDS MySQL can be published to CloudWatch Logs. Once the logs are in CloudWatch Logs, you can create a metric filter to count the number of slow queries per minute and set a CloudWatch alarm on that metric to alert when the count exceeds a threshold. Option A is incorrect because RDS Events provide notifications about instance events (e.g., failover, maintenance), not slow query metrics. Option B is incorrect because Enhanced Monitoring provides OS-level metrics (e.g., CPU, memory) but not slow query log data. Option C is incorrect because CloudTrail records API calls made to AWS services, not SQL queries executed within RDS.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use RDS Events to send slow query metrics to CloudWatch.
Why it's wrong here
Amazon RDS Events are notifications generated for database instance lifecycle occurrences—such as failovers, maintenance windows, snapshots, and patching—not for query-level performance data. They do not parse the MySQL slow query log nor emit metrics about individual queries, so they cannot be used to detect or alarm on slow SQL statements.
- ✗
Enable RDS Enhanced Monitoring and publish metrics to CloudWatch.
Why it's wrong here
RDS Enhanced Monitoring publishes operating-system-level metrics—such as CPU utilization, memory, file I/O, and network traffic—from the DB instance's hypervisor into CloudWatch, but it does not capture or forward database slow query logs. These OS metrics can help diagnose resource pressure behind slow performance, but they provide no visibility into the actual SQL statements or their frequency.
- ✗
Use AWS CloudTrail to monitor SQL queries.
Why it's wrong here
AWS CloudTrail captures control-plane API calls made to the RDS service, such as creating, modifying, or deleting DB instances, and does not record data-plane activity like SQL statements issued by applications. Since slow query monitoring requires analyzing executed queries, CloudTrail logs are entirely unsuitable for this purpose; they contain no SQL text or database performance metrics.
- ✓
Publish slow query logs to CloudWatch Logs, create a metric filter, and set an alarm.
Why this is correct
The correct approach is to enable the RDS MySQL slow query log by setting slow_query_log=1 and long_query_time in the DB parameter group, then configure RDS to stream those logs to a CloudWatch Logs log group. Once the log events are flowing, you create a CloudWatch Logs metric filter—patterned to match the slow query log format, such as lines containing 'Query_time'—to count matching events as a custom metric, and then set a CloudWatch alarm to trigger when the count exceeds a threshold.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.