本文說明 Google Kubernetes Engine 部署作業如何使用 Google Cloud Managed Service for Prometheus,從 llm-d 收集指標。llm-d 由許多元件組成,包括 GKE Inference Gateway 和 vLLM。
如要瞭解如何從 GKE Inference Gateway 和 vLLM 收集指標,請參閱下列文件:
- GKE Inference Gateway
- vLLM. 請使用本文所述的 PodMonitoring 資源設定。
只有在使用 Managed Service for Prometheus 的 代管收集作業時,才適用這些文件中的操作說明。如果您使用自行部署的收集功能,請參閱 llm-d 說明文件。
設定 GKE Inference Gateway 和 vLLM 後,即可存取 Cloud Monitoring 中的預先定義資訊主頁,查看指標。
必要條件
如要使用 Managed Service for Prometheus 和代管收集作業,從 llm-d 收集指標,部署作業必須符合下列規定:
- 叢集必須執行 Google Kubernetes Engine 1.28.15-gke.2475000 以上版本。
- 您必須執行 Managed Service for Prometheus,並啟用代管收集作業。詳情請參閱「 開始使用代管集合」一文。
您也必須變更 vLLM 的 PodMonitoring 資源設定。請使用下列設定:
apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
name: llm-d-metrics
spec:
selector:
matchLabels:
llm-d.ai/model: ms-pd-llm-d-modelservice
endpoints:
- port: 8200
interval: 10s
path: /metrics
targetLabels:
fromPod:
- from: llm-d.ai/role
to: role
metadata:
- pod
- container
- node
- top_level_controller_name
- top_level_controller_type
查看資訊主頁
Cloud Monitoring 整合功能包含 llm-d Prometheus 總覽資訊主頁。設定整合作業後,系統會自動安裝資訊主頁。 您也可以查看資訊主頁的靜態預覽畫面,不需安裝整合功能。
如要查看已安裝的資訊主頁,請按照下列步驟操作:
-
在 Google Cloud 控制台中,前往「Dashboards」(資訊主頁)
頁面:
如果您是使用搜尋列尋找這個頁面,請選取子標題為「Monitoring」的結果。
- 選取「資訊主頁清單」分頁標籤。
- 選擇「整合」類別。
- 按一下資訊主頁名稱,例如「llm-d Prometheus Overview」。
如要查看資訊主頁的靜態預覽畫面,請按照下列步驟操作:
-
前往 Google Cloud 控制台的
「Integrations」(整合) 頁面:如果您是使用搜尋列尋找這個頁面,請選取子標題為「Monitoring」的結果。
- 按一下「Kubernetes Engine」部署平台篩選器。
- 找出 llm-d 整合項目,然後按一下「查看詳細資料」。
- 選取「資訊主頁」分頁標籤。