適用於容器的 Azure 監視器概觀Azure Monitor for containers overview

容器的 Azure 監視器是一項功能,其設計是用來監視部署到的容器工作負載效能:Azure Monitor for containers is a feature designed to monitor the performance of container workloads deployed to:

  • 裝載于 Azure Kubernetes Service (AKS)上的受控 Kubernetes 叢集Managed Kubernetes clusters hosted on Azure Kubernetes Service (AKS)
  • Azure 容器執行個體Azure Container Instances
  • 裝載于 Azure Stack 或內部部署環境的自我管理 Kubernetes 叢集Self-managed Kubernetes clusters hosted on Azure Stack or on-premises
  • Azure Red Hat OpenShiftAzure Red Hat OpenShift

適用于容器的 Azure 監視器支援執行 Linux 和 Windows Server 2019 作業系統的叢集。Azure Monitor for containers supports clusters running the Linux and Windows Server 2019 operating system.

監視容器很重要,尤其在您使用多個應用程式大規模執行生產環境叢集時。Monitoring your containers is critical, especially when you're running a production cluster, at scale, with multiple applications.

適用於容器的 Azure 監視器可藉由透過計量 API 從 Kubernetes 中取得的控制器、節點與容器來收集記憶體與處理器計量,為您提供效能可見度。Azure Monitor for containers gives you performance visibility by collecting memory and processor metrics from controllers, nodes, and containers that are available in Kubernetes through the Metrics API. 容器記錄也會一併收集。Container logs are also collected. 當您從 Kubernetes 叢集啟用監視之後,系統會透過適用于 Linux 的 Log Analytics 代理程式容器化版本自動收集計量和記錄。After you enable monitoring from Kubernetes clusters, metrics and logs are automatically collected for you through a containerized version of the Log Analytics agent for Linux. 計量會寫入計量存放區,並將記錄資料寫入與您的Log Analytics工作區相關聯的記錄存放區。Metrics are written to the metrics store and log data is written to the logs store associated with your Log Analytics workspace.

容器的 Azure 監視器架構

適用於容器的 Azure 監視器提供哪些功能?What does Azure Monitor for containers provide?

適用于容器的 Azure 監視器可使用 Azure 監視器的不同功能來提供完整的監視體驗。Azure Monitor for containers delivers a comprehensive monitoring experience using different features of Azure Monitor. 這些功能可讓您瞭解執行 Linux 和 Windows Server 2019 作業系統的 Kubernetes 叢集的效能和健康情況,以及容器工作負載。These features enable you to understand the performance and health of your Kubernetes cluster running Linux and Windows Server 2019 operating system, and the container workloads. 使用適用于容器的 Azure 監視器,您可以:With Azure Monitor for containers you can:

  • 識別正在節點上執行的 AKS 容器,以及其平均的處理器與記憶體使用率。Identify AKS containers that are running on the node and their average processor and memory utilization. 此知識可協助您識別資源瓶頸。This knowledge can help you identify resource bottlenecks.

  • 識別容器群組及其裝載於 Azure Container Instances 之容器的處理器和記憶體使用率。Identify processor and memory utilization of container groups and their containers hosted in Azure Container Instances.

  • 識別容器在控制器或 Pod 中的所在位置。Identify where the container resides in a controller or a pod. 此知識可協助您檢視控制器或 Pod 的整體效能。This knowledge can help you view the controller's or pod's overall performance.

  • 檢閱在和支援 Pod 的標準程序無關之主機上執行的工作負載的資源使用率。Review the resource utilization of workloads running on the host that are unrelated to the standard processes that support the pod.

  • 了解叢集在平均負載和最高負載之下的行為。Understand the behavior of the cluster under average and heaviest loads. 此知識可協助您識別所需的容量,並判斷叢集可承受的負載上限。This knowledge can help you identify capacity needs and determine the maximum load that the cluster can sustain.

  • 設定警示,以主動通知您,或在節點或容器上的 CPU 和記憶體使用率超過閾值時,或在基礎結構或節點健全狀況匯總套件中發生健全狀況狀態變更時加以記錄。Configure alerts to proactively notify you or record it when CPU and memory utilization on nodes or containers exceed your thresholds, or when a health state change occurs in the cluster at the infrastructure or nodes health rollup.

  • Prometheus整合,以查看它從節點和 Kubernetes 收集的應用程式和工作負載計量使用查詢來建立自訂警示、儀表板,以及詳細的執行詳細分析。Integrate with Prometheus to view application and workload metrics it collects from nodes and Kubernetes using queries to create custom alerts, dashboards, and detailed perform detailed analysis.

  • 監視部署至 AKS 引擎內部部署的容器工作負載,以及 Azure Stack 上的AKS 引擎Monitor container workloads deployed to AKS Engine on-premises and AKS Engine on Azure Stack.

  • 監視部署至 Azure Red Hat OpenShift的容器工作負載。Monitor container workloads deployed to Azure Red Hat OpenShift.

    注意

    Azure Red Hat OpenShift 的支援目前是公開預覽中的一項功能。Support for Azure Red Hat OpenShift is a feature in public preview at this time.

與 Linux 叢集相較之下,監視 Windows Server 叢集的主要差異如下:The main differences in monitoring a Windows Server cluster compared to a Linux cluster are the following:

  • 記憶體 RSS 計量不適用於 Windows 節點和容器。Memory RSS metric isn't available for Windows node and containers.
  • 磁片儲存體容量資訊不適用於 Windows 節點。Disk storage capacity information isn't available for Windows nodes.
  • 容器記錄不適用於在 Windows 節點中執行的容器。Container logs aren't available for containers running in Windows nodes.
  • 「即時資料」(預覽)功能支援適用于 Windows 容器記錄的例外狀況。Live Data (preview) feature support is available with the exception of Windows container logs.
  • 只有 pod 環境會受到監視,而不是 Docker 環境。Only pod environments are monitored, not Docker environments.
  • 在預覽版本中,最多可支援30個 Windows Server 容器。With the preview release, a maximum of 30 Windows Server containers are supported. 這項限制不適用於 Linux 容器。This limitation doesn't apply to Linux containers.

查看下列提供中繼層級深入探討的影片,以協助您瞭解如何使用容器的 Azure 監視器監視 AKS 叢集。Check out the following video providing an intermediate level deep dive to help you learn about monitoring your AKS cluster with Azure Monitor for containers.

如何存取此功能?How do I access this feature?

您有兩種方式可用來存取適用於容器的 Azure 監視器:從 Azure 監視器或直接從所選取的 AKS 叢集。You can access Azure Monitor for containers two ways, from Azure Monitor or directly from the selected AKS cluster. 從 Azure 監視器中,您會看到所有已部署的容器的全域觀點,這些都是受監視的,而不是,可讓您在訂用帳戶和資源群組之間進行搜尋和篩選,然後向下切入至容器的 Azure 監視器選取的容器。From Azure Monitor, you have a global perspective of all the containers deployed, which are monitored and which are not, allowing you to search and filter across your subscriptions and resource groups, and then drill into Azure Monitor for containers from the selected container. 否則,您可以直接從 [AKS] 頁面中選取的 AKS 容器存取該功能。Otherwise, you can access the feature directly from a selected AKS container from the AKS page.

存取適用於容器的 Azure 監視器方法概觀

如果您想要監視和管理在 AKS 外部執行的 Docker 和 Windows 容器主機,以查看設定、audit 和資源使用率,請參閱容器監視解決方案If you are interested in monitoring and managing your Docker and Windows container hosts running outside of AKS to view configuration, audit, and resource utilization, see the Container Monitoring solution.

後續步驟Next steps

若要開始監視您的 Kubernetes 叢集,請參閱如何啟用容器的 Azure 監視器,以瞭解啟用監視的需求和可用方法。To begin monitoring your Kubernetes cluster, review How to enable the Azure Monitor for containers to understand the requirements and available methods to enable monitoring.