惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
罗磊的独立博客
The GitHub Blog
The GitHub Blog
L
LangChain Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
DataBreaches.Net
宝玉的分享
宝玉的分享
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
N
Netflix TechBlog - Medium
The Cloudflare Blog
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
美团技术团队
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis
Monitor RDS MySQL using Datadog
John Matson · 2015-10-20 · via Datadog | The Monitor blog

This post is part 3 of a 3-part series on monitoring MySQL on Amazon RDS. Part 1 explores the key metrics available from RDS and MySQL, and Part 2 explains how to collect both types of metrics.

If you’ve already read our post on collecting MySQL RDS metrics, you’ve seen that you can easily collect metrics from RDS and from MySQL itself to check on your database. For a more comprehensive view of your database’s health and performance, however, you need a monitoring system that can integrate and correlate RDS metrics with native MySQL metrics, that lets you identify both recent and long-term trends in your metrics, and that can help you identify and investigate performance problems. This post will show you how to connect MySQL RDS to Datadog for monitoring in two steps:

  • Connect Datadog to CloudWatch to gather RDS metrics

  • Integrate Datadog with MySQL to gather native metrics

For an even more expansive view of your database instances, you can enable the new RDS enhanced monitoring feature, which provides more than 50 system-level metrics at a frequency as high as once per second. Those metrics can be ingested into Datadog for monitoring in just minutes:

  • Monitor RDS enhanced metrics with Datadog

Connect Datadog to CloudWatch

rds-dd-diagram

To start monitoring RDS metrics, you will need to configure the AWS CloudWatch integration, which requires read-only access to your AWS account. In order to do this, you’ll need to set up role delegation in AWS IAM, create a new role for Datadog, and attach a policy that grants the Datadog role read-only access to your AWS services. See the integration documentation for detailed instructions and permissions information.

After you’ve created the Datadog role, fill in your AWS account ID and the name of your role in the “Role Delegation” tab of the AWS integration tile in Datadog. Check off “RDS” under the “Limit metric collection” section, as well as any other services you wish to monitor.

Integrate Datadog with MySQL

As explained in Part 1, RDS provides you with several valuable metrics that apply to MySQL, Postgres, SQL Server, or any of the other supported RDS database engines. To collect metrics specifically tailored to MySQL, however, you must monitor the MySQL instance itself.

Installing the Datadog Agent on EC2

Datadog’s Agent integrates seamlessly with MySQL to gather and report key performance metrics, many of which are not available through RDS. Where the same metrics are available through the Agent and through basic CloudWatch metrics, Agent metrics should be preferred, as they are reported at a higher resolution. Installing the Agent is easy: it usually requires just a single command, and the Agent can collect metrics even if the MySQL performance schema is not enabled and the sys schema is not installed. Installation instructions for different operating systems are available here.

Because RDS does not provide you direct access to the machines running MySQL, you cannot install the Agent on the MySQL instance to collect metrics locally. Instead you must run the Agent on another machine, often an EC2 instance in the same security group. See Part 2 of this series for more on accessing MySQL via EC2.

Configuring the Agent for RDS

Collecting MySQL metrics from an EC2 instance is quite similar to running the Agent alongside MySQL to collect metrics locally, with two small exceptions:

  1. Instead of localhost as the server name, provide the Datadog Agent with your RDS instance endpoint (e.g., instance_name.xxxxxxx.us-east-1.rds.amazonaws.com)

  2. Tag your MySQL metrics with the DB instance identifier (dbinstanceidentifier:instance_name) to separate database metrics from the host-level metrics of your EC2 instance

The RDS instance endpoint and DB instance identifier are both available from the AWS console. Complete instructions for configuring the Agent to capture MySQL metrics from RDS are available here.

Unifying your metrics

Once you have set up the Agent, all the metrics from your database instance will be uniformly tagged with dbinstanceidentifier:instance_name for easy retrieval, whether those metrics come from RDS or from MySQL itself.

View your comprehensive MySQL RDS dashboard

Once you have integrated Datadog with RDS, a comprehensive dashboard called “Amazon - RDS (MySQL)” will appear in your list of integration dashboards. The dashboard gathers the metrics highlighted in Part 1 of this series: metrics on query throughput and performance, along with key metrics around resource utilization, database connections, and replication status.

rds-dash-load

By default the dashboard displays native MySQL metrics from all reporting instances, as well as RDS metrics from all instances running MySQL. You can focus on one particular instance by selecting a dbinstanceidentifier variable in the upper left.

db-id

Customize your dashboard

The Datadog Agent can also collect metrics from the rest of your infrastructure so that you can correlate your entire system’s performance with metrics from MySQL. The Agent collects metrics from ELB, NGINX, Redis, and 1,000+ other infrastructural applications. You can also easily instrument your own application code to report custom metrics to Datadog using StatsD.

To add more metrics from MySQL or other systems to your RDS dashboard, clone the template dash by clicking on the gear in the upper right.

Monitor RDS enhanced metrics with Datadog

AWS provides the option to enable enhanced monitoring for RDS instances running MySQL, MariaDB, Aurora, and other database engines. Enhanced monitoring includes more than 50 new CPU, memory, file system, and disk I/O metrics that can be collected on a per-instance basis as frequently as once per second.

AWS has worked with Datadog to help customers monitor this high-resolution data. With a few minutes of work your enhanced RDS metrics will immediately begin populating a pre-built, customizable dashboard in Datadog.

Pre-built Datadog RDS dashboard with enhanced metrics

You can enable enhanced RDS metrics during instance creation, or on an existing RDS instance by using the RDS Console. When you enable enhanced RDS metrics, the metrics will be written to CloudWatch Logs. You can then use a ready-made Lambda function (available in the AWS Serverless Application Repository) to process those metrics and send them to Datadog. Enhanced metrics can be collected even if you do not use the Datadog Agent to monitor your RDS instances.

To set up Datadog’s RDS Enhanced integration, follow the instructions in our documentation.

Customize your enhanced metrics dashboard

Once you have enabled “RDS” in Datadog’s AWS integration tile, Datadog will immediately begin displaying your enhanced RDS metrics. You can clone the pre-built dashboard for enhanced metrics and customize it however you want: add MySQL-specific metrics that are not displayed by default, or start correlating database metrics with the performance of the rest of your stack.

Conclusion

In this post we’ve walked you through integrating RDS MySQL with Datadog so you can access all your database metrics in one place, whether standard metrics from MySQL and CloudWatch or enhanced metrics from RDS.

Monitoring RDS with Datadog gives you critical visibility into what’s happening with your database and the applications that depend on it. You can easily create automated alerts on any metric, with triggers tailored precisely to your infrastructure and your usage patterns.

If you don’t yet have a Datadog account, you can sign up for a free trial and start monitoring your cloud infrastructure, your applications, and your services today.