Monitoring RDS with Datadog - Integration, Enhanced Monitoring, and DBM

With Amazon RDS, simply enabling RDS in the AWS integration delivers CPU and connection counts. Per-process OS metrics are handled by Enhanced Monitoring and a dedicated Lambda, and per-SQL slowness by the Agent and Database Monitoring, with different work to add at each tier.

Whether the AWS Integration Alone Is Enough Depends on the Questions You Want to Answer

The gap between metrics such as CPU utilization and "which SQL is slow" is described in the Database Monitoring explanation, and with RDS you close that gap through three tiers of work. The Datadog RDS integration divides monitoring into three forms, Standard / Enhanced / Native: the deeper the tier, the finer the metrics that arrive, and the work to add spreads to both the AWS side and the DB side (as of October 2026; source: Amazon RDS).

The three tiers of RDS monitoring and the work to add for each
TierData pathWhat arrivesWork to add
Tier 1 (Standard)The AWS integration retrieves it from CloudWatchInstance-level metrics such as CPU utilization, connection count, and read and write latencyEnable RDS in the integration UI and add three IAM permissions
Tier 2 (Enhanced)Agent on RDS → CloudWatch Logs → LambdaPer-process CPU and memory, load average, swapEnable Enhanced Monitoring on the RDS side and prepare a KMS key and a Lambda
Tier 3 (Native + DBM)An Agent placed on a separate host logs in to the DB directlyPer-query metrics, samples of running queries, execution plansParameter group, a read-only DB user, Agent configuration
Source: Amazon RDS / Setting Up Database Monitoring for Amazon RDS managed Postgres

When choosing a tier, you will not hesitate if you first write down what you want to answer after an incident. "Was the DB slow?" is answered at tier 1. If you want to separate "was the slowness the DB engine, or some other process running on the same instance?", you need tier 2, and if you want to go as far as saying "which query was the cause?", you need tier 3. Tiers 2 and 3 are independent of each other, but both build on the AWS integration of tier 1. If you skip tier 1 and add only tier 3, infrastructure metrics such as CPU do not appear in the DBM UI. Tier 3, DBM, is billed per monitored DB host, so check the unit price on Datadog's official pricing page. The mechanism is summarized in the Database Monitoring explanation, and the combined total with other products in the pricing guide.

In Tier 1, Check RDS in the Integration UI and Add Three IAM Permissions

Complete the connection to your account (role, external ID, and regions to collect from) with the AWS integration setup steps; here, add only the RDS-specific work. On the Metric Collection tab of the AWS integration UI, confirm that RDS is enabled, add the following three permissions to the IAM policy you give Datadog, and then install the Amazon RDS integration tile (as of October 2026).

Permissions to add to the IAM policy in tier 1
PermissionWhat Datadog uses it for
rds:DescribeDBInstancesLists instances and tags them
rds:ListTagsForResourceCopies custom tags attached to RDS onto metrics
rds:DescribeEventsIngests RDS events as Datadog events
Source: Amazon RDS

The metrics that arrive begin with aws.rds., such as aws.rds.cpuutilization, aws.rds.database_connections, and aws.rds.replica_lag, and all engines are covered. The ingestion interval follows the CloudWatch integration settings, so if you want to shorten ingestion delay, one option is to switch to Metric Streams. If Performance Insights is enabled on the RDS side, the aws.rds.dbload family, which represents the number of active sessions, also arrives, and up to this point you can read quite a lot about "whether the DB is being kept waiting." On the other hand, CloudWatch CPU utilization is a value measured from the hypervisor side, and it does not tell you which process inside the instance used it. Tier 1 also contains no query-level information at all.

Enhanced Monitoring Arrives by a Separate Path Through CloudWatch Logs

Tier 2 metrics are not CloudWatch metrics. They are OS values collected by an AWS agent running on the RDS instance and written out to the RDSOSMetrics log group in CloudWatch Logs. Datadog reads this log group with a dedicated Lambda function, converts it into metrics, and sends them. The targets are MySQL / Aurora / MariaDB / SQL Server / Oracle / PostgreSQL, and the work proceeds in the AWS console in the following order (as of October 2026).

  • RDS: Enable Enhanced Monitoring when creating the instance or with Modify, and choose the collection interval (Monitoring Granularity). Datadog's recommended value is 15
  • KMS: Create a customer managed key. Give it an alias such as lambda-datadog-key, and do not start it with aws
  • Lambda: In the same region, deploy the serverless app Datadog-RDS-Enhanced and enter the key ID in KMSKeyId
  • Environment variables: Put the API key as JSON in kmsEncryptedKeys, encrypt it with the same key, and save
  • Trigger: Choose CloudWatch Logs and specify RDSOSMetrics as the log group
Source: Amazon RDS / Monitoring OS metrics with Enhanced Monitoring

This function is a different thing from the Datadog Forwarder for logs, and it handles only RDS OS metrics. If you already have an API key encrypted for the Forwarder, the function's README describes how to reuse it. You cannot create a test event from the Test tab, so verify operation by whether aws.rds.cpuutilization.total or aws.rds.process.cpuUsedPc appears on the Datadog side. On the cost side, AWS charges arise when CloudWatch Logs transfer and storage exceed the amount available for free, and that amount is proportional to the granularity. AWS also suggests changing the granularity per instance as a way to keep costs down (source: Monitoring OS metrics with Enhanced Monitoring).

Before Tier 3, Decide Where the Agent Lives and the Parameter Group

You cannot install the Agent on an RDS instance, so in tier 3 you place the Agent on a separate host and have it connect over the network to each instance's endpoint. The example in the official documentation is a small EC2 instance dedicated to the Agent, and installing the Agent itself is the same as in installing the Agent on Linux. An Agent that runs DBM must be 7.36.1 or later, the engine lower bounds are 9.6 for PostgreSQL and 5.6 for MySQL, and the list of supported versions is at the start of the setup steps for Postgres and MySQL (as of October 2026). At the same time, enable Resource Collection in the AWS integration UI. What you change first on the DB side is the parameter group, and the items differ by engine.

Items to change in the DB parameter group for DBM
EngineParameterValueRequired or not, and role
PostgreSQLshared_preload_librariespg_stat_statementsRequired. The source of the query metrics postgresql.queries.*
PostgreSQLtrack_activity_query_size4096Required. With the default, SQL longer than 1024 characters cannot be captured
PostgreSQLtrack_io_timingonOptional. Captures per-query block read and write time
MySQLperformance_schema1Required. Enables the Performance Schema
MySQLmax_digest_length4096Required. Keeps digests of long SQL without truncating them
MySQLperformance_schema_max_digest_length / performance_schema_max_sql_text_length4096Match max_digest_length (the latter is 5.7 or later)
Source: Setting Up Database Monitoring for Amazon RDS managed Postgres / Setting Up Database Monitoring for Amazon RDS managed MySQL

For both engines, the official documentation requires a server restart after you change the values. Under AWS's specifications, the default parameter group cannot be modified, so create a new group, enter the values, and associate it with the instance. Both the values of a newly associated group and changes to static parameters take effect only after the instance restarts (source: Overview of parameter groups). If you cannot choose the restart time for a production DB, you can also arrange to complete only creating and associating the group first and leave applying it to a planned restart. What takes the most time in tier 3 is coordinating this restart.

Queries Become Visible with a Read-Only User and the dbm: true Setting

The Agent logs in to the DB as a read-only user and collects statistics and queries. In PostgreSQL, in a replication setup, create the datadog user on the primary (the write side). On 10 or later, create a datadog schema in each database, grant the pg_monitor role, and create the pg_stat_statements extension. On 15 or later, in addition, enable role inheritance with ALTER ROLE datadog INHERIT. In MySQL, grant datadog@'%' privileges such as SELECT on performance_schema. On RDS, consumers cannot be enabled permanently through configuration, so you also create a procedure that the Agent uses to enable them at run time. The items in the subsequent Agent configuration, and what each is responsible for, are as follows.

What each item in the Agent configuration is responsible for
ItemWhat it is responsible for
dbm: trueIn addition to the normal DB integration, collects query metrics and execution samples
aws.instance_endpoint / aws.regionLinks the DB the Agent is watching to the RDS instance in the AWS integration
dbinstanceidentifier tagSet to the same value as the RDS identifier, so that tier 1 metrics and DB-side metrics line up on the same axis
ENC[…]Reads the password from the Agent's secrets management rather than placing it in plain text
ssl: allowAdd only for Agent 7.49 or earlier
Source: Setting Up Database Monitoring for Amazon RDS managed Postgres / Amazon RDS

The place to write it is postgres.d/conf.yaml for PostgreSQL and mysql.d/conf.yaml for MySQL. After saving, restart the Agent and check whether postgres or mysql appears in the Checks section of the status subcommand. A shortened PostgreSQL example looks like this (as of October 2026).

init_config:
instances:
  - dbm: true
    host: '<AWS_INSTANCE_ENDPOINT>'
    port: 5432
    username: datadog
    password: 'ENC[datadog_user_database_password]'
    aws:
      instance_endpoint: '<AWS_INSTANCE_ENDPOINT>'
      region: '<REGION>'
    tags:
      - "dbinstanceidentifier:<DB_INSTANCE_NAME>"

Connect to the Instance Itself - Cautions for Aurora and IAM Authentication

Make the instance you want to monitor itself the Agent's connection target. The official documentation asks you not to put a proxy, a load balancer, or a connection pooler such as pgbouncer in between. If the connection target changes on failover, the Agent ends up computing the difference between the statistics of two machines, and the metrics go wrong. If you connect to an Aurora cluster endpoint, you see only one randomly chosen replica. Either write the instance endpoints one by one, or use the Autodiscovery for Aurora clusters that Datadog recommends (source: Setting Up Database Monitoring for Aurora managed Postgres). If you use IAM authentication, place managed_authentication under aws and set enabled to true. IAM authentication takes precedence over password, so do not enable it in environments that do not use it (as of October 2026).

Stop at the Tier That Answers Your Questions, and Bring the Other Instances into Line

The dashboards Datadog provides differ by tier, so each time you add one, you can check the difference in the UI.

Preset dashboards available at each tier
TierMain metrics shown on the dashboard
Tier 1 (Standard)Connections, replication lag, read and write counts and latency, RAM, disk
Tier 2 (Enhanced)Load average, per-process CPU and memory, swap, network send and receive, file system utilization
Tier 3 (Native)Three dashboards for MySQL / Aurora / PostgreSQL. Query volume, disk I/O, connections, replication, AWS-side metrics
Source: Amazon RDS

After adding tier 2, putting tier 1's aws.rds.cpuutilization and tier 2's aws.rds.cpuutilization.total on the same graph shows the difference (metric names as of October 2026). According to AWS, the former is measured by the hypervisor and the latter by the agent on the instance, so the values diverge, and the smaller the instance class, the wider the gap (source: Monitoring OS metrics with Enhanced Monitoring). For tier 3, run one query you know to be slow and check whether it appears in normalized form in the Databases UI. Each time you add a tier, judge whether you can answer the questions you wrote down at the start with this UI, and stop that instance at the tier where you can. What you decide next is the order in which to bring all instances with the same role up to that tier, and which maintenance window to put the parameter group restart in.

References

Share