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

监视服务器的相关数据有助于排查工作负荷故障及优化工作负荷。Monitoring data about your servers helps you troubleshoot and optimize for your workload. Azure Database for MariaDB 提供了各种指标来帮助用户深入了解服务器的行为。Azure Database for MariaDB 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. 其他任务包括设置自动操作、执行高级分析和存档历史记录。Other tasks include setting up automated actions, performing advanced analytics, and archiving history. 有关详细信息,请参阅 Azure 指标概述For more information, see the Azure Metrics Overview.

有关分步指南,请参阅如何设置警报For step by step guidance, see How to set up alerts.

指标列表List of metrics

以下指标适用于 Azure Database for MariaDB:These metrics are available for Azure Database for MariaDB:

指标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. (不适用于基本层服务器)(Not applicable for Basic tier servers)
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 计数Count 服务器的活动连接数。The number of active connections to the server.
connections_failedconnections_failed 失败的连接数Failed Connections 计数Count 服务器的失败连接数。The number of failed connections to the server.
seconds_behind_masterseconds_behind_master 复制延迟(秒)Replication lag in seconds 计数Count 副本服务器滞后于主服务器的秒数。The number of seconds the replica server is lagging against the master server. (不适用于基本层服务器)(Not applicable for Basic tier servers)
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. 此指标表示根据为服务器设置的备份保留期保留的所有完整数据库备份、差异备份和日志备份所消耗的存储的总和。This metric represents the sum of storage consumed by all the full database backups, differential backups, and log backups retained based on the backup retention period set for the server. 备份的频率由服务管理,并在概念文章中进行了说明。The frequency of the backups is service managed and explained in the concepts article. 对于异地冗余存储,备份存储使用率是本地冗余存储的两倍。For geo-redundant storage, backup storage usage is twice that of the locally redundant storage.

服务器日志Server logs

可以在服务器上启用慢查询日志记录。You can enable slow query 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 server logs page.

查询存储Query Store

查询存储可以随着时间的推移跟踪查询性能,包括查询运行时统计信息和等待事件。Query Store 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 InsightQuery 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 MariaDB 服务器门户页的“智能性能”部分中访问 Query Performance Insight。Query Performance Insight is accessible in the Intelligent Performance section of your Azure Database for MariaDB 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.

后续步骤Next steps

  • 若要深入了解如何使用 Azure 门户、REST API 或 CLI 访问和导出指标,请参阅 Azure 指标概述For more information on how to access and export metrics using the Azure portal, REST API, or CLI, see the Azure Metrics Overview.