Datadog’s Autodiscovery enables you to configure monitoring in dynamic infrastructures. You can use this feature to monitor your Aurora clusters without having to list individual database host endpoints (for example, postgres.d/conf.yaml). This is especially helpful for clusters that use Aurora Auto Scaling, which dynamically adjusts the number of Aurora Replicas in response to variations in connectivity or workload. Autodiscovery automatically discovers and monitors both primary and replica endpoint instances.
With Autodiscovery and Database Monitoring, you can define configuration templates for Postgres or MySQL checks and specify which clusters to apply each check to.
The Datadog Agent requires permission to run rds:DescribeDBClusters and rds:DescribeDBInstances in your AWS account. Datadog recommends that you attach an IAM role policy to the EC2 instance where the Agent is running.
By default, the listener discovers all Aurora clusters in the account and region where the Agent is running that have the datadoghq.com/scrape:true tag applied. You can also configure the Agent to discover clusters with specific tags.
You must apply these tags to the DB cluster (Role: Regional cluster). For more information on tagging RDS resources, see the AWS documentation.
Autodiscovery uses an Agent service listener, which discovers all database host endpoints in an Aurora cluster and forwards discovered endpoints to the existing Agent check scheduling pipeline. You can configure the listener in the datadog.yaml file:
Note: The Agent only discovers Aurora instances running in the same region as the Agent. To determine the region of the instance, the Agent uses IMDS (Instance Metadata Service). If your EC2 instance requires IMDSv2, you must configure the Agent to use IMDSv2 by setting ec2_prefer_imdsv2: true in datadog.yaml, as shown below:
By default, the listener only discovers Aurora clusters in the account and region where the Agent is running, and only those with the datadoghq.com/scrape:true tag. You can also configure the listener to discover clusters with specific tags.
To specify custom tags for Aurora cluster discovery in the datadog.yaml file:
The listener queries the AWS API for the list of hosts in a loop. The frequency with which the listener queries the AWS API, in seconds, is configurable in the datadog.yaml file:
The Datadog Agent supports configuration templates for the Postgres and MySQL integrations. Define a configuration template for the Aurora clusters you wish to monitor.
In this example, the template variables %%host%%, %%port%%, %%extra_dbclusteridentifier%%, and %%extra_region%% are dynamically populated with information from the Aurora cluster.
To use [IAM authentication][2] to connect to your Aurora cluster, use the following template:
In this example, the template variables %%host%%, %%port%%, %%extra_dbclusteridentifier%%, and %%extra_region%% are dynamically populated with information from the Aurora cluster.