Google Cloud Managed Service for Prometheus,用于查看和分析 GKE Dataplane V2 指标。您可以修改 Google Cloud Managed Service for Prometheus 配置,以添加或移除您为 Google Cloud Managed Service for Prometheus 提取选择的指标。
自行管理的 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"]],["最后更新时间 (UTC):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)"]]