Courseiva
Monitoring and Logging →hardMultiple Select

Export RDS MySQL Slow Query Logs to CloudWatch Logs

A company uses Amazon RDS for MySQL and wants to monitor slow queries to optimize performance. Which actions should the DevOps engineer take to capture and analyze slow query logs? (Choose THREE.)

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

✓

Enable the slow query log parameter in the RDS DB parameter group

To capture and analyze slow query logs in Amazon RDS for MySQL, the DevOps engineer should enable the slow query log parameter in the DB parameter group (B), configure RDS to publish logs to Amazon CloudWatch Logs (D), and use CloudWatch Logs Insights to query and analyze the logs (E). Option A (CloudTrail) captures API activity, not SQL queries. Option C (Performance Insights) monitors database performance metrics but does not capture slow query logs.

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 AWS CloudTrail to capture SQL queries

    Why it's wrong here

    AWS CloudTrail records API calls made to the RDS service, such as CreateDBInstance, ModifyDBParameterGroup, or RebootDBInstance, but it does not capture SQL statements executed inside the database. The SLO requirement is to monitor query performance, which requires database-level logging — CloudTrail simply cannot see into the SQL layer. To obtain slow query data, you must enable the MySQL slow query log parameter rather than relying on API auditing.

  • ✓

    Enable the slow query log parameter in the RDS DB parameter group

    Why this is correct

    In the RDS DB parameter group for MySQL, set slow_query_log to 1 or ON and define long_query_time with the desired threshold (for example, 2 seconds) — these parameters control which queries are written to the slow query log. This log records the exact SQL text, query execution time, and timestamp for every query exceeding the threshold, giving you the raw data needed to calculate SLO metrics like the ratio of slow queries to total queries. Because slow_query_log is a dynamic parameter for MySQL in RDS, you can apply the change immediately without rebooting the database instance.

  • ✗

    Enable RDS Performance Insights

    Why it's wrong here

    RDS Performance Insights is a database performance monitoring feature that visualizes database load, waits, SQL statement top-N, and host activity in real time; it does not generate slow query logs or store historical log files. While it can help identify expensive queries, its aggregated data model does not expose the complete raw text and execution timing of every slow query as the slow query log does. For SLO monitoring, the authoritative source is the slow query log, not the Performance Insights dashboard.

  • ✓

    Configure RDS to publish logs to Amazon CloudWatch Logs

    Why this is correct

    RDS for MySQL can be configured to publish the slow query log (along with error log and general log) to Amazon CloudWatch Logs by selecting the appropriate log types in the 'Log exports' section of the RDS console or via the API. This creates a CloudWatch log group (e.g., /aws/rds/instance/<dbname>/slowquery) to which the RDS agent streams log lines in near real time. Once published, the logs are searchable, filterable, and can be retained centrally for compliance and analysis.

  • ✓

    Use CloudWatch Logs Insights to query and analyze the slow query logs

    Why this is correct

    CloudWatch Logs Insights enables you to run SQL-like queries (using a query language) against the slow query logs stored in CloudWatch Logs, for instance parsing the log pattern with `parse @message` and aggregating with `stats avg(query_time), count(*)` by query text. You can filter logs to a specific time range and use interactive query syntax to identify which SQL statements exceed your SLO threshold and how often. This turns static logs into an actionable monitoring dashboard or serves as a source for metric filters and alarms.

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 1,298 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.