使用容器见解配置 PV 监视Configure PV monitoring with Container insights

从代理版本 ciprod10052020 开始,集成了用于容器的 Azure Monitor 的代理现在支持监视 PV(永久性卷)使用情况。Starting with agent version ciprod10052020, Azure Monitor for containers integrated agent now supports monitoring PV (persistent volume) usage. 代理版本为 ciprod01112021 的代理支持对 PV 清单进行监视,提供的信息涉及状态、存储类、类型、访问模式以及其他详细信息。With agent version ciprod01112021, the agent supports monitoring PV inventory, including information about the status, storage class, type, access modes, and other details.

PV 指标PV metrics

通过以 60 秒为间隔收集以下指标并将这些指标存储在 InsightMetric 表中,容器见解会自动开始监视 PV 使用情况。Container insights automatically starts monitoring PV usage by collecting the following metrics at 60 -sec intervals and storing them in the InsightMetrics table.

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

请在此处详细了解如何配置收集的 PV 指标。Learn more about configuring collected PV metrics here.

PV 清单PV inventory

适用于容器的 Azure Monitor 会自动以 60 秒为间隔收集以下信息并将这些信息存储在 KubePVInventory 表中,通过这种方式开始监视 PV。Azure Monitor for containers automatically starts monitoring PVs by collecting the following information at 60-sec intervals and storing them in the KubePVInventory table.

数据Data 数据源Data Source 数据类型Data Type 字段Fields
Kubernetes 群集中永久性卷的清单Inventory of persistent volumes in a Kubernetes cluster Kube APIKube API KubePVInventory PVName、PVCapacityBytes、PVCName、PVCNamespace、PVStatus、PVAccessModes、PVType、PVTypeInfo、PVStorageClassName、PVCreationTimestamp、TimeGenerated、ClusterId、ClusterName、_ResourceIdPVName, PVCapacityBytes, PVCName, PVCNamespace, PVStatus, PVAccessModes, PVType, PVTypeInfo, PVStorageClassName, PVCreationTimestamp, TimeGenerated, ClusterId, ClusterName, _ResourceId

监视永久性卷Monitor Persistent Volumes

适用于容器的 Azure Monitor 在每个群集的工作簿模板中包含此使用情况指标和清单信息的预配置图表。Azure Monitor for containers includes pre-configured charts for this usage metric and inventory information in workbook templates for every cluster. 还可以启用针对 PV 使用情况的建议警报,并在 Log Analytics 中查询这些指标。You can also enable a recommended alert for PV usage, and query these metrics in Log Analytics.

工作负荷详细信息工作簿Workload Details Workbook

通过从左窗格、“见解”窗格的“查看工作簿”下拉列表或“见解”窗格的“报表(预览版)”选项卡选择“工作簿”,可以直接从 AKS 群集中“工作负荷详细信息”工作簿的“永久卷”选项卡中找到特定工作负荷的使用情况图表 。You can find usage charts for specific workloads in the Persistent Volume tab of the Workload Details workbook directly from an AKS cluster by selecting Workbooks from the left-hand pane, from the View Workbooks drop-down list in the Insights pane, or from the Reports (preview) tab in the Insights pane.

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

永久性卷详细信息工作簿Persistent Volume Details Workbook

通过从左窗格、“见解”窗格的“查看工作簿”下拉列表或“见解”窗格的“报表(预览版)”选项卡选择“工作簿”,可以直接从 AKS 群集中“永久性卷详细信息”工作簿中找到永久性卷清单的概述 。You can find an overview of persistent volume inventory in the Persistent Volume Details workbook directly from an AKS cluster by selecting Workbooks from the left-hand pane, from the View Workbooks drop-down list in the Insights pane, or from the Reports (preview) tab in the Insights pane.

Azure Monitor PV 详细信息工作簿示例

后续步骤Next steps

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