在 Azure Database for MySQL 中进行监视Monitoring in Azure Database for MySQL

Note

将要查看的是 Azure Database for MySQL 的新服务。You are viewing the new service of Azure Database for MySQL. 若要查看经典 MySQL Database for Azure 的文档,请访问此页To view the documentation for classic MySQL Database for Azure, please visit this page.

监视服务器的相关数据有助于排查工作负荷故障及优化工作负荷。Monitoring data about your servers helps you troubleshoot and optimize for your workload. Azure Database for MySQL 提供了各种指标来帮助用户深入了解服务器的行为。Azure Database for MySQL provides various metrics that give insight into the behavior of your server.

度量值Metrics

所有 Azure 指标的频率都是一分钟,每个指标提供 30 天的历史记录。All Azure metrics have a one-minute frequency, and each metric provides 30 days of history. 可针对指标配置警报。You can configure alerts on the metrics. 有关分步指南,请参阅如何设置警报For step by step guidance, see How to set up alerts. 其他任务包括设置自动操作、执行高级分析和存档历史记录。Other tasks include setting up automated actions, performing advanced analytics, and archiving history. 有关详细信息,请参阅 Azure 指标概述For more information, see the Azure Metrics Overview.

指标列表List of metrics

这些指标适用于 Azure Database for MySQL:These metrics are available for Azure Database for MySQL:

指标Metric 指标显示名称Metric Display Name 单位Unit 说明Description
cpu_percentcpu_percent CPU 百分比CPU percent 百分比Percent 使用的 CPU 百分比。The percentage of CPU in use.
memory_percentmemory_percent 内存百分比Memory percent 百分比Percent 使用的内存百分比。The percentage of memory in use.
io_consumption_percentio_consumption_percent IO 百分比IO percent 百分比Percent 使用的 IO 百分比。The percentage of IO in use.
storage_percentstorage_percent 存储百分比Storage percentage 百分比Percent 所用存储占服务器最大存储的百分比。The percentage of storage used out of the server's maximum.
storage_usedstorage_used 已用的存储量Storage used 字节Bytes 使用的存储量。The amount of storage in use. 服务使用的存储可能包括数据库文件、事务日志和服务器日志。The storage used by the service may include the database files, transaction logs, and the server logs.
serverlog_storage_percentserverlog_storage_percent 服务器日志存储空间百分比Server Log storage percent 百分比Percent 所用的服务器日志存储占服务器的服务器日志最大存储的百分比。The percentage of server log storage used out of the server's maximum server log storage.
serverlog_storage_usageserverlog_storage_usage 服务器日志已用的存储量Server Log storage used 字节Bytes 使用的服务器日志存储量。The amount of server log storage in use.
serverlog_storage_limitserverlog_storage_limit 服务器存储空间上限Server Log storage limit 字节Bytes 此服务器的最大服务器日志存储。The maximum server log storage for this server.
storage_limitstorage_limit 存储限制Storage limit 字节Bytes 此服务器的最大存储。The maximum storage for this server.
active_connectionsactive_connections 活动连接数Active Connections CountCount 服务器的活动连接数。The number of active connections to the server.
connections_failedconnections_failed 失败的连接数Failed Connections CountCount 服务器的失败连接数。The number of failed connections to the server.
seconds_behind_masterseconds_behind_master 复制延迟(秒)Replication lag in seconds CountCount 副本服务器针对主服务器延迟的秒数。The number of seconds the replica server is lagging against the master server.
network_bytes_egressnetwork_bytes_egress 网络传出Network Out 字节Bytes 跨活动连接数的网络传出。Network Out across active connections.
network_bytes_ingressnetwork_bytes_ingress 网络传入Network In 字节Bytes 跨活动连接数的网络传入。Network In across active connections.
backup_storage_usedbackup_storage_used 使用的备份存储Backup Storage Used 字节Bytes 已使用的备份存储量。The amount of backup storage used.

服务器日志Server logs

可以在服务器上启用慢查询和审核日志。You can enable slow query and audit logging on your server. 这些日志也可通过 Azure Monitor 日志、事件中心和存储帐户中的 Azure 诊断日志获得。These logs are also available through Azure Diagnostic Logs in Azure Monitor logs, Event Hubs, and Storage Account. 若要详细了解日志记录,请访问 审核日志慢查询日志文章。To learn more about logging, visit the audit logs and slow query logs articles.

查询存储Query Store

查询存储是一项跟踪一段时间内查询性能(包括查询运行时统计信息和等待事件)的功能。Query Store is a feature that keeps track of query performance over time including query runtime statistics and wait events. 此功能将查询运行时性能信息保留在 mysql 架构中。The feature persists query runtime performance information in the mysql schema. 你可以通过各种配置旋钮控制数据的收集和存储。You can control the collection and storage of data via various configuration knobs.

查询性能见解Query Performance Insight

Query Performance Insight 与查询存储协同工作以提供可以从 Azure 门户访问的可视化效果。Query Performance Insight works in conjunction with Query Store to provide visualizations accessible from the Azure portal. 这些图表使你能够识别对性能造成影响的关键查询。These charts enable you to identify key queries that impact performance. 可以在 Azure Database for MySQL 服务器门户页的“智能性能” 部分中访问 Query Performance Insight。Query Performance Insight is accessible in the Intelligent Performance section of your Azure Database for MySQL server's portal page.

性能建议Performance Recommendations

性能建议功能可以确定提高工作负荷性能的机会。The Performance Recommendations feature identifies opportunities to improve workload performance. 性能建议为你提供了有关创建新索引的建议,这些索引可能会提高工作负荷的性能。Performance Recommendations provides you with recommendations for creating new indexes that have the potential to improve the performance of your workloads. 若要生成索引建议,该功能会考虑各种数据库特征,包括其架构以及如“查询存储”报告的工作负载。To produce index recommendations, the feature takes into consideration various database characteristics, including its schema and the workload as reported by Query Store. 实施任何性能建议后,客户应测试性能以评估这些更改的影响。After implementing any performance recommendation, customers should test performance to evaluate the impact of those changes.

计划内维护通知Planned maintenance notification

“计划内维护通知” 允许你接收有关 Azure Database for MySQL 即将进行的计划内维护的警报。Planned maintenance notifications allow you to receive alerts for upcoming planned maintenance to your Azure Database for MySQL. 这些通知与服务运行状况计划内维护集成,允许你在同一位置查看你的订阅的所有计划内维护。These notifications are integrated with Service Health's planned maintenance and allow you to view all scheduled maintenance for your subscriptions in one place. 它还有助于将通知扩展到不同资源组的适当受众,因为你可能有不同的联系人负责不同的资源。It also helps to scale the notification to the right audiences for different resource groups, as you may have different contacts responsible for different resources. 你将在事件发生前的 72 小时收到有关即将进行的维护的通知。You will receive the notification about the upcoming maintenance 72 hours before the event.

Note

我们将尽一切努力为所有事件提供计划内维护通知 72 小时通知。We will make every attempt to provide Planned maintenance notification 72 hours notice for all events. 但是,对于关键或安全修补程序,通知可能会在事件快要发生时更晚一点发送,或者会被忽略。However, in cases of critical or security patches, notifications might be sent closer to the event or be omitted.

接收计划内维护通知To receive planned maintenance notification

  1. 门户中,选择“服务运行状况” 。In the portal, select Service Health.
  2. 在“警报” 部分中,选择“运行状况警报” 。In the Alerts section, select Health alerts.
  3. 选择“+ 添加服务运行状况警报” ,并填写字段。Select + Add service health alert and fill in the fields.
  4. 填写所需的字段。Fill out the required fields.
  5. 选择“事件类型” ,然后选择“计划内维护” 或“全选” Choose the Event type, select Planned maintenance or Select all
  6. 在“操作组” 中,定义接收警报的方式(获取电子邮件、触发逻辑应用等)。In Action groups define how you would like to receive the alert (get an email, trigger a logic app etc.)
  7. 确保“创建后启用规则”设置为“是”。Ensure Enable rule upon creation is set to Yes.
  8. 选择“创建警报规则” 以完成警报Select Create alert rule to complete your alert

有关如何创建服务运行状况警报 的详细步骤,请参阅 创建有关服务通知的活动日志警报For detailed steps on how to create service health alerts, refer to Create activity log alerts on service notifications.

Important

计划内维护通知目前为预览版Planned maintenance notifications are currently in preview

后续步骤Next steps