使用用于容器的 Azure Monitor 配置 PV 监视Configure PV monitoring with Azure Monitor for containers

从代理版本 ciprod10052020 开始,集成了用于容器的 Azure Monitor 的代理现在支持监视 PV(永久性卷)使用情况。Starting with agent version ciprod10052020, Azure Monitor for containers integrated agent now supports monitoring PV (persistent volume) usage.

PV 指标PV metrics

通过以 60 秒的间隔收集以下指标并将其存储在 InsightMetric 表中,用于容器的 Azure Monitor 会自动开始监视 PV。Azure Monitor for containers automatically starts monitoring PV by collecting the following metrics at 60sec intervals and storing them in the InsightMetrics table.

指标名称Metric name 指标维度(标记)Metric dimension (tags) 说明Description
pvUsedBytes container.azm.ms/pv 特定永久性卷的已用空间(以字节为单位),并包含由特定 pod 使用的声明。Used space in bytes for a specific persistent volume with a claim used by a specific pod. pvCapacityBytes 在“标记”字段中折叠为一个维度,以便降低数据引入成本并简化查询。pvCapacityBytes is folded in as a dimension in the Tags field to reduce data ingestion cost and to simplify queries.

监视永久性卷Monitor Persistent Volumes

用于容器的 Azure Monitor 在每个集群的工作簿中包含此指标的预配置图表。Azure Monitor for containers includes pre-configured charts for this metric in a workbook for every cluster. 可以通过在左侧窗格中选择“工作簿”,直接从 AKS 群集的“工作负载详细信息”工作簿的“永久性卷”选项卡中找到图表,也可以通过 Insight 中的“查看工作簿”下拉列表找到 。You can find the charts in the Persistent Volume tab of the Workload Details workbook directly from an AKS cluster by selecting Workbooks from the left-hand pane, and from the View Workbooks drop-down list in the Insight. 还可以启用针对 PV 使用情况的建议警报,并在 Log Analytics 中查询这些指标。You can also enable a recommended alert for PV usage, as well as query these metrics in Log Analytics.

Azure Monitor PV 工作负载工作簿示例

后续步骤Next steps

  • 在此处详细了解收集的 PV 指标。Learn more about collected PV metrics here.