Google Cloud Managed Service for Prometheus,即可查看及分析 GKE Dataplane V2 指標。您可以修改 Google Cloud Managed Service for Prometheus 設定,新增或移除要擷取至 Google Cloud Managed Service for Prometheus 的指標。
Cloud Monitoring Metrics Explorer,查看 Pod 層級的流量流動詳細資料。
自行管理的 Grafana,用於顯示 Google Cloud Managed Service for Prometheus 收集的指標。
啟用 Google Cloud Managed Service for Prometheus 時,請注意下列事項:
GKE 會建立 PodMonitoring 資源
GKE 會公開指標端點
如要使用 Google Cloud Managed Service for Prometheus 擷取指標,並建立 PodMonitoring 資源,必須在叢集上啟用 Google Cloud Managed Service for Prometheus。如果您未啟用 Google Cloud Managed Service for Prometheus,GKE 會公開指標端點,但不會建立PodMonitoring資源。
為叢集啟用 GKE Dataplane V2 指標後,Google Cloud Managed Service for Prometheus 會擷取下列 GKE Dataplane V2 指標:
此外,您也可以使用其他指標,包括來自開放原始碼可觀測性平台 Hubble 的指標。根據預設,Google Cloud Managed Service for Prometheus 不會擷取這些額外指標,但您可以設定 Google Cloud Managed Service for Prometheus 收集這些指標。如要收集這些指標,請設定 PodMonitoring 自訂資源 (CR)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-01 (世界標準時間)。"],[],[],null,["# About GKE Dataplane V2 observability\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nGKE Dataplane V2 observability provides GKE Dataplane V2 metrics and insights\ninto workloads on GKE clusters on Google Cloud.\nWith GKE Dataplane V2 observability, starting with\nGKE versions **1.28** or later, you can:\n\n- Capture, observe, and alert on network metrics using [Google Cloud Managed Service for Prometheus](/stackdriver/docs/managed-prometheus) and [Cloud Monitoring](/monitoring) with [Metrics Explorer](/monitoring/charts/metrics-explorer)\n- Understand traffic flows for a particular Service in a cluster\n- Understand and identify issues with the network health of a Kubernetes workload\n- Verify [Kubernetes Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/)\n\nGKE Dataplane V2 observability offers the following troubleshooting tools:\n\n- A Kubernetes cluster Network Topology\n- A Kubernetes Network Policy verdict table with live traffic flows and connection information\n- Command-line tooling for troubleshooting Kubernetes traffic flows\n\n### GKE Dataplane V2 metrics\n\nGKE Dataplane V2 metrics provide traffic flow information for the following:\n\n- **Traffic flows:** insights about how GKE handles flows between Pods and Services.\n- **Network policy enforcement:** information about how GKE\n enforces Kubernetes Network Policies.\n\n | **Note:** Observability draws insights from Layer 3 and Layer 4 network data. This aligns with GKE's Network Policies, which also function at Layer 3 and Layer 4.\n\nYou can use GKE Dataplane V2 metrics to monitor and troubleshoot Kubernetes\nworkloads using the following tools:\n\n- **Google Cloud Managed Service for Prometheus** to view and analyze your GKE Dataplane V2 metrics. You can modify the Google Cloud Managed Service for Prometheus configuration to add or remove the metrics of your choice for Google Cloud Managed Service for Prometheus ingestion.\n- **Cloud Monitoring Metrics Explorer** to view Pod-level traffic flow details.\n- **Cloud Monitoring** to explore and use any metric. For example, you can create alerts that trigger when GKE Dataplane V2 metrics exceed certain thresholds.\n- **Self-managed Grafana** to visualize metrics collected by Google Cloud Managed Service for Prometheus.\n\nWhen you enable Google Cloud Managed Service for Prometheus:\n\n- GKE creates a `PodMonitoring` resource\n- GKE exposes the metrics endpoint\n\nTo consume metrics with Google Cloud Managed Service for Prometheus and to be able to create a\n`PodMonitoring` resource, you must enable Google Cloud Managed Service for Prometheus\non the cluster. If you don't enable Google Cloud Managed Service for Prometheus, GKE\nexposes the metrics endpoint but does not create a `PodMonitoring`\nresource.\n\nWhen you enable GKE Dataplane V2 metrics for a cluster,\nGoogle Cloud Managed Service for Prometheus ingests the following GKE Dataplane V2 metrics:\n\nEnabling GKE Dataplane V2 metrics opens the metrics port on each Kubernetes node.\n\nAdditional metrics are also available, including from the open source\nobservability platform [Hubble](https://docs.cilium.io/en/v1.13/observability/metrics/#hubble).\nBy default, Google Cloud Managed Service for Prometheus doesn't ingest these additional metrics\nbut you can configure Google Cloud Managed Service for Prometheus to collect them. To collect\nthese metrics, [configure a `PodMonitoring` custom resource (CR)](/stackdriver/docs/managed-prometheus/setup-managed#gmp-pod-monitoring).\n\nThe following table describes additional Hubble metrics:\n\n### GKE Dataplane V2 observability tools\n\nGKE Dataplane V2 observability provides a Managed Hubble solution with network\nobservability and security insights for Kubernetes workloads deployed with\nGKE Dataplane V2.\n\nWhen enabled, GKE Dataplane V2 observability deploys the following components to\nyour cluster:\n\n- **Hubble Relay:** a service that collects network telemetry data about your\n Pods from each node.\n\n- **Hubble CLI:** a command-line interface tool providing live traffic\n information within the cluster.\n\nYou can deploy the following component after you enable GKE Dataplane V2\nobservability to your cluster:\n\n- **Hubble UI:** a web-based tool that you can use to view and analyze the network telemetry data that is collected by Hubble Relay. You must enable GKE Dataplane V2 observability to deploy Hubble UI.\n\nHow GKE Dataplane V2 metrics and observability works\n----------------------------------------------------\n\nGKE Dataplane V2 observability uses the following components and tools to\ncollect metrics and provide insights into your network traffic:\n\n- GKE Dataplane V2: GKE Dataplane V2 metrics and observability use\n GKE Dataplane V2 datapath based on [eBPF](https://ebpf.io/what-is-ebpf/)\n to collect metrics about traffic flows and network policy enforcement for a Pod\n based on a given workload.\n\n- [Google Cloud Managed Service for Prometheus](/stackdriver/docs/managed-prometheus):\n GKE Dataplane V2 metrics configures the Google Cloud Managed Service for Prometheus agent to\n ingest aggregated metrics to Google Cloud Managed Service for Prometheus, a scalable\n monitoring solution that can ingest and store large amounts of data that also\n lets you build on the [Google Cloud Observability](/stackdriver/docs/solutions/gke).\n\n- [Hubble](https://github.com/cilium/hubble): GKE Dataplane V2 observability\n uses Hubble, an open source observability project. Hubble enables network\n observability and security insights for Kubernetes workloads deployed with an\n eBPF Dataplane.\n\n Hubble flow events occur when:\n - A network connection is first established\n\n - A TCP flag is first seen, which indicates the state of the TCP connection\n\n - A packet is transmitted after at least five seconds have passed since the last\n flow event\n\n **Hubble metrics:** counts the number of flow events in a Kubernetes cluster\n that you can use to identify which Pods are communicating with each other.\n | **Note:** Hubble flow metrics don't count the amount of data or number of packets transmitted.\n- **Enabling metrics and observability:** You can enable GKE Dataplane V2 and\n observability independent of each other. To enable Network topology\n visualization in open source Hubble UI feature, you must enable Network inspection.\n\n- **Autopilot clusters:**\n\n - Metrics are enabled by default\n\n - Observability tools are disabled by default\n\n - You must create the Cluster`PodMonitoring` resource to gather metrics in the\n Google Cloud Managed Service for Prometheus\n\n- **Standard clusters:**\n\n - Metrics are disabled by default\n\n - Observability tools are disabled by default\n\n - If you have Google Cloud Managed Service for Prometheus enabled, a `PodMonitoring` resource\n is created automatically\n\n - A `PodMonitoring` resource is marked as **ensure exists** . You can stop\n sending metrics to Google Cloud Managed Service for Prometheus by editing the\n `PodMonitoring` resource to disable all metrics\n\n### GKE Dataplane V2 observability endpoints\n\nGKE Dataplane V2 observability components expose the following two observability\nendpoints:\n\n- **Metrics endpoint:** an HTTP endpoint that exposes traffic metrics in\n Prometheus format. The `anetd` Pod exposes the metrics endpoint on each cluster\n node on port 9965.\n\n- **Flows port:** a gRPC endpoint. The `hubble-relay` Pod exposes the flows port\n endpoint as a Kubernetes `ClusterIP` Service on port 443. The `hubble-relay`\n Pod is the backend for the Kubernetes `ClusterIP` Service and all requests to\n the Kubernetes `ClusterIP` Service are forwarded to the `hubble-relay` Pod.\n You can access the flow port using Hubble CLI or the Hubble UI.\n\nLimitations\n-----------\n\n- GKE Dataplane V2 observability has a cluster-wide limit of 5000 nodes.\n- GKE Dataplane V2 metrics and observability only work in clusters on Google Cloud with [GKE Dataplane V2](/kubernetes-engine/docs/concepts/dataplane-v2) enabled.\n- GKE Dataplane V2 metrics are similar to Hubble metrics in that they are implemented as flow-based metrics to provide connection information. These metrics don't count the amount of data nor number of packets transmitted. Given that the metrics are flow-based, they don't provide an accurate representation of the amount of data transmitted in a network flow.\n\nWhat's next\n-----------\n\n- [Set up GKE Dataplane V2 observability](/kubernetes-engine/docs/how-to/configure-dpv2-observability)\n- [Observe your traffic using GKE Dataplane V2 observability](/kubernetes-engine/docs/how-to/observe-your-traffic)"]]