本文說明如何使用 Azure 監視器和 Kubernetes 監視來監視您的部署。
Azure 監視器
Azure 監視器 是完整堆疊監視服務,可用來監視 Azure 資源的可用性、效能和作業。
Azure 監視器計量
Azure 監視器計量 是 Azure 監視器的一項功能,可將資料從受監視的資源收集到時間序列資料庫中。
這些指標可以源自許多不同的來源,包括原生平台指標、透過 Azure Monitor Application Insights 的原生自訂指標,以及 Azure 受控 Prometheus。
Prometheus 計量可以儲存在 Azure 監視器工作區 中,以便透過 Azure 受控 Grafana 進行後續視覺效果。
計量組態
若要配置 Azure 監視器抓取 Prometheus 度量資料,請參閱 適用於 Prometheus 抓取設定的 Azure 監視器受控服務 這篇文章,該文章是以 此 configmap 為基礎的。 Azure Arc 啟用的 Azure 容器儲存體指定 prometheus.io/scrape:true 和 prometheus.io/port 值,並依賴預設值 prometheus.io/path: '/metrics'。 您必須在底下 pod-annotation-based-scraping 指定 Azure 容器儲存體安裝命名空間,才能正確設定計量擷取的範圍。
完成 Prometheus 設定之後,請遵循 Azure 受控 Grafana 指示 來建立 Azure 受控 Grafana 執行個體。
Azure 監視器記錄
Azure 監視器記錄 是 Azure 監視器的一項功能,可從受監視的資源收集和組織記錄和效能資料,並可用來 以多種方式分析此資料。
記錄設定
如果您想要透過 Azure 監視器存取記錄資料,您必須在已啟用 Arc 的 Kubernetes 叢集上啟用 Azure 監視器容器深入解析,然後使用檢視和活頁簿的集合來分析收集的資料。
此外,您可以使用 Azure 監視器 Log Analytics 來查詢收集的記錄資料。