Prepare and test your skills
Prepare and test your skills
Hybrid and multi-cloud metric aggregation is the practice of forwarding numeric time-series data from Google Cloud services, virtual machines (VMs), on-premises infrastructure, and other clouds into one queryable store in Cloud Monitoring (opens in a new tab). Distributed collectors scrape or receive metrics near each workload, then data flows from each collector to Monarch, the globally scalable datastore behind both Cloud Monitoring and Google Cloud Managed Service for Prometheus. A single Grafana instance, Metrics Explorer chart, or alerting policy can then query that global store with PromQL instead of connecting to individual Prometheus servers in each environment.
Monarch is the central storage and query layer that makes unified monitoring possible across regions, projects, and clouds. Data storage in Monarch retains Prometheus data for 24 months, while query evaluation in Monarch executes PromQL and unions results across all Google Cloud regions and across up to 3,500 Google Cloud projects. The metrics scope of a Google Cloud project controls which stored time series can be charted or monitored by that project, because by default the scope limits the project to time series stored by that project alone. An operator expands visibility by configuring the metrics scope to include time series stored by other projects, so alerts, dashboards, and service-level objectives (SLOs) operate over the consolidated set.
The Ops Agent is the collection pipeline for Linux and Windows VMs running on Compute Engine, including third-party applications that automatic Compute Engine system metrics do not cover. The agent collects host metrics for CPU, disk, memory, swap, GPU, and processes, plus system logs such as syslog and Windows Event Log, and it adds third-party integrations for software such as Apache Web Server, Nginx, MySQL, Redis, MongoDB, PostgreSQL, and Java Virtual Machine. The same agent can scrape Prometheus metrics through its Prometheus receiver and receive OpenTelemetry Protocol (OTLP) metrics and traces through its OTLP receiver, then send that data to the global datastore. Because the Ops Agent handles VM discovery directly on the instance, data flows from the local system and application endpoints to the agent to Cloud Monitoring without installing a separate Prometheus server in the VM environment.
Cloud Monitoring separates third-party collection by platform: third-party telemetry on Compute Engine is collected by the Ops Agent, while third-party telemetry on Google Kubernetes Engine (GKE) is collected by Google Cloud Managed Service for Prometheus. This division keeps host-level collection with the VM agent and keeps container collection with the Prometheus-compatible pipeline, even though both pipelines land in the same Monitoring backend where the same alerting, charting, and dashboard services apply.
BindPlane is the documented path for collecting on-premises and hybrid-cloud metrics into Cloud Monitoring alongside Google Cloud-native metrics. BindPlane extends the unified pipeline beyond environments where the Ops Agent or GKE-based collectors run natively, so diverse external infrastructure metrics are consolidated into time series stored by a Google Cloud project. Once ingested, those external series are subject to the same project metrics scope, PromQL querying, dashboards, and alerting policies as system metrics generated by Google Cloud services. Choose BindPlane when the source is on-premises or hybrid infrastructure that must be mapped into the same Monitoring project as cloud workloads for end-to-end health, saturation, and availability analysis.
Google Cloud Managed Service for Prometheus is the fully managed, multi-cloud solution for Prometheus and OpenTelemetry metrics that separates collection, query evaluation, rule evaluation, and storage into different components. Data collection is handled by collectors that scrape local exporters and forward data to Monarch, and those collectors can run in GKE, on VMs, on-premises, and on any cloud, with outside-Google Cloud collectors sending to Monarch for long-term storage and global querying. Rule and alert evaluation is handled either by PromQL alerts in Cloud Monitoring that fully execute in the cloud, or by locally run rule-evaluator components that evaluate against the global Monarch store and forward fired alerts to Prometheus Alertmanager. Grafana then connects to the global Monarch store rather than to each Prometheus server, so one Grafana instance provides a unified view when collectors are deployed in every environment.
Collectors can be operated in three principal Kubernetes and VM patterns compared below. Managed collection uses a Kubernetes operator that generates scrape configuration, scales ingestion, and scopes rules through lightweight custom resources. Self-deployed collection runs the drop-in replacement binary instead of the upstream Prometheus binary, preserving existing deployment methods and configs. The OpenTelemetry Collector provides a single-agent strategy for metrics, logs, and traces in any compute or Kubernetes environment, including push-based patterns and stateless environments such as Cloud Run with a sidecar.
| Collection option | Operation and configuration | Choose when |
|---|---|---|
| Managed collection | Google-recommended operator for GKE and non-GKE Kubernetes, deployed by GKE UI, gcloud CLI, kubectl CLI, or Terraform; scraping and rules use PodMonitoring, ClusterPodMonitoring, and ClusterNodeMonitoring custom resources with Prometheus relabeling | Hands-off operation, intuitive migration from prometheus-operator, and full Google Cloud support are needed |
| Self-deployed collection | Drop-in Prometheus binary with existing annotations or prometheus-operator configs; scaling and functional sharding are manual and rules typically run inside each server | Reusing complex existing setups, running upstream and managed servers side by side, or evaluating rules locally at the edge without network traffic is needed |
| OpenTelemetry Collector | Single collector for Prometheus metrics, logs, and traces, deployed manually or by Terraform; Prometheus receiver uses Prometheus-like configs, metadata is injected by resource-detector processors, and rules use Cloud Monitoring alerting or standalone evaluator | Cross-signal workflows, exemplars, push-based collection, and consistent collection from any cloud or on-premises environment are needed |
Accurate global querying depends on consistent resource mapping during ingestion. The OpenTelemetry path maps diverse sources by exporting with the googlemanagedprometheus exporter, extracting Kubernetes metadata with the k8sattributes processor, setting project_id, location, cluster, and namespace attributes, and populating top_level_controller_name and top_level_controller_type labels for workload identity. Managed collection discovers the same workload identity through Prometheus service-discovery metadata and adds top_level_controller_{name,type} to target labels during ingestion. First verify that a wanted metric is not already covered by an active GKE system or curated package, because filtering for a metric that is already ingested by an active package creates duplicate series in Monitoring.
Exam tip: Use the Ops Agent for third-party telemetry on Compute Engine and Google Cloud Managed Service for Prometheus for third-party telemetry on GKE; use BindPlane to bring on-premises and hybrid-cloud metrics into the same Cloud Monitoring store.
Network and Service Mesh observability via Cloud Service Mesh is the collection and analysis of telemetry from Envoy proxies in the data plane to understand transit latency, traffic patterns, and inter-service communication. The data plane runs Envoy proxies as sidecars beside each workload, or as proxyless gRPC clients, while the managed control plane distributes routing and telemetry configuration. Telemetry flows from each proxy to Google Cloud Observability (opens in a new tab), where Cloud Monitoring, Cloud Logging, and Cloud Trace store it for dashboards, topology views, and deep filtering.
Envoy telemetry reporting is the periodic push of signals from each sidecar proxy to the Google Cloud Observability APIs. The proxy batches and exports each signal type on its own schedule, so logs arrive fastest, metrics and topology edges arrive about every minute, and traces depend on sampling. Full telemetry can be delayed 1-2 minutes while clusters start, which is normal during rollout or restart. The reporting path depends on the proxy having the Google Cloud Observability filter configured and the Cloud Monitoring API enabled in the project.
Envoy proxies in Cloud Service Mesh report four telemetry signals:
Automatic service insights are preconfigured dashboards and topology maps in the Google Cloud console that are generated for workloads configured through the Istio APIs. Service metrics and logs for HTTP traffic inside the mesh GKE cluster are automatically ingested to Google Cloud without custom instrumentation. In-depth telemetry powered by Cloud Monitoring, Cloud Logging, and Cloud Trace lets operators filter and segment data on attributes such as source, destination, response code, and version. Service-to-service relationships show dependencies and who connects to each service, plus communication security posture and service level objectives (SLOs) for health.
Cloud Service Mesh also maintains a service registry of mesh services by name and endpoint, such as Kubernetes Pod IPs or Compute Engine managed instance group IPs. Because proxies run side-by-side with services, traffic flows from the client-side Envoy to the server-side Envoy to the destination endpoint, and both sides can emit telemetry for the same request. This two-sided view makes it possible to compare client-observed latency and errors against server-observed latency and errors to isolate transit versus service faults.
The Istio Telemetry API is the custom resource that controls how proxies generate and customize telemetry in a managed Traffic Director control plane. In most channels only one cluster-wide configuration is supported, specifically a single Telemetry custom resource in the root namespace, default istio-system. In the rapid channel multiple configurations are supported at root, namespace, and workload-selector levels, with priority highest for selector-specific and lowest for root level. When only one configuration takes effect, any previous customization must be merged into the new resource or it will be lost.
To list the configuration, run kubectl -n istio-system get telemetry and verify that at most one object exists outside rapid channel. If multiple objects exist where only one is supported, only the first one takes effect and the others are ignored. This check matters when metrics, access logs, or tracing behavior change unexpectedly after a new Telemetry resource is applied.
Diagnosing mesh behavior means correlating request metrics, topology edges, logs, and sampled traces from Envoy proxies. Request metrics reveal volume, error rate, and latency distribution between services, while edges reveal the path traffic takes through the mesh over time. Trace sampling at about 1% provides end-to-end execution paths that link an ingress request to downstream calls, which helps separate a slow service from slow transit between services. When a failure affects one source-to-destination pair but not others, comparing region and zone dimensions points to routing, locality load balancing, or cross-region transit rather than a global outage.
The control plane also exports its own metrics to Cloud Monitoring for viewing in Metrics Explorer:
| Metric | What it measures | Grouping dimensions |
|---|---|---|
| xDS API Connected Streams | Number of xDS clients connected to the control plane | Client connection count |
| Request count | Number of requests sent to a backend service | Source region, destination region, request status |
| Request count by zone | Number of requests sent to a backend service | Source zone, destination zone, request status |
These control-plane metrics complement proxy telemetry: a drop in connected streams points to control-plane connectivity loss, while a shift in request count by region or zone with rising error status points to traffic shifting or failing across locations.
Exam tip: Cloud Service Mesh dashboards display metrics only for HTTP(S) and gRPC services whose Kubernetes Service port is named http or starts with http-; TCP byte streams can carry traffic but TCP metrics are not collected or reported.
Troubleshooting missing service metrics is an ordered check from workload injection through proxy configuration to API delivery. A missing sidecar means no proxy exists to emit telemetry, a missing filter means the proxy cannot export to Google Cloud, and a wrong port name means the mesh treats the traffic as TCP rather than HTTP. Even with correct proxy state, disabled APIs, quota exhaustion, or reporting errors prevent metrics from reaching dashboards. Follow the checks in order because each later step depends on the earlier one succeeding.
istio-proxy with kubectl -n YOUR_NAMESPACE get pods. A missing label for automatic injection or failed manual injection leaves only the application container with no mesh telemetry.kubectl debug targeting istio-proxy and fetching localhost:15000/config_dump. Look for the Google Cloud Observability filter with root_id and vm_id set to stackdriver_inbound.http or has an http- prefix. Without this name, metrics will not appear in the Services dashboard even though traffic flows.429 responses indicates a quota issue, which is then checked under IAM and Admin Quotas for the Cloud Monitoring API.kubectl -n YOUR_NAMESPACE logs YOUR_POD_NAME -c istio-proxy and search for error instances. Ignore the normal warning about mTLS PERMISSIVE mode allowing plaintext or TLS without a client certificate, and focus on reporting or configuration errors.Google Cloud Managed Service for Prometheus (GMP) is Google Cloud's fully managed, multi-cloud solution for Prometheus and OpenTelemetry metrics. GMP collects metrics from Prometheus exporters and OpenTelemetry sources, stores the data globally, and lets teams query it with PromQL in Cloud Monitoring (opens in a new tab), Grafana, or any Prometheus API client. The service stays compatible with upstream Prometheus, supports Kubernetes, virtual machines (VMs), and Cloud Run, retains data for 24 months, and can be combined with over 6,500 free Cloud Monitoring metrics using PromQL.
GMP is built on Monarch, the globally scalable datastore also used by Cloud Monitoring. A standard Prometheus server handles collection, query, rules, and storage in one process, while GMP splits those duties. Collectors scrape local exporters and forward samples from any cloud or on-premises site to Monarch, Monarch evaluates queries across all regions and up to 3,500 Google Cloud projects in a metrics scope, Monarch stores the data, and rules are evaluated either by PromQL alerting policies in Cloud Monitoring or by a standalone rule evaluator that queries Monarch and forwards fired alerts to Prometheus Alertmanager. Grafana connects to Monarch instead of to individual servers, so one Grafana instance shows metrics from every deployment that forwards to Monarch.
Collection architecture in GMP separates local scraping from global storage and querying. A managed collector, self-deployed collector, OpenTelemetry Collector, or Ops Agent runs near the workload, scrapes the /metrics or OTLP endpoint exposed by the application or exporter, and sends the time series to Monarch for long-term storage and global PromQL querying. Because only the collector needs local network access to the target, collectors running outside Google Cloud can still provide hybrid and multi-cloud visibility without opening the workload to the global query layer.
The four collectors differ in ownership, configuration style, and operational tradeoff:
| Collector | Configuration model | Choose when |
|---|---|---|
| Managed collection | Lightweight custom resources managed by a Kubernetes operator; deployed by GKE UI, gcloud CLI, kubectl CLI, or Terraform | Kubernetes workloads need hands-off scraping, scaling, and sharding with full Google Cloud support |
| Self-deployed collection | Drop-in GMP binary with existing Prometheus configs, annotations, or prometheus-operator; scaling and sharding are manual | Complex existing Prometheus setups must be reused side by side, edge rules must evaluate locally without network traffic, or local aggregation is needed to reduce cardinality |
| OpenTelemetry Collector | Prometheus-like receiver config plus resource processors; deployed manually or by Terraform, including stateless Cloud Run | One agent must handle metrics, logs, and traces, push-based collection is needed, or cross-signal features such as exemplars matter |
| Ops Agent | Prometheus-like receiver powered by OpenTelemetry on Compute Engine; deployed by gcloud CLI, Compute Engine UI, or Terraform | Linux or Windows VMs need simple discovery without installing Prometheus, plus optional logging and process metrics |
Managed collection is the recommended approach for Kubernetes because the operator generates scrape configs, scales ingestion, and scopes rules to the right data. Self-deployed collection and the OpenTelemetry Collector receive limited assistance from Google Cloud support, while managed collection and the Ops Agent receive full assistance.
PodMonitoring and ClusterPodMonitoring are the managed-collection custom resources that define which Pods to scrape and how to filter their metrics. PodMonitoring scrapes only Pods in the namespace where the PodMonitoring object is deployed, so the same manifest must be deployed in each namespace to cover multiple namespaces. ClusterPodMonitoring scrapes matching Pods in any namespace from a single cluster-scoped object. A third resource, ClusterNodeMonitoring, scrapes node components such as kubelet and cAdvisor rather than application Pods.
Filtering uses Prometheus relabeling rules inside the custom resource to keep only wanted series, which controls cardinality, cost, and duplication:
/metrics and /metrics/cadvisor for kubelet and cAdvisor signals.A typical PodMonitoring manifest selects an exporter by labels and scrapes it on a named port every 30 seconds. For example, a DCGM manifest with matchLabels: app: nvidia-dcgm-exporter and endpoints: port: metrics, interval: 30s directs the managed collector to scrape the NVIDIA DCGM Exporter Pod and forward GPU utilization, performance, and health metrics to Monarch. The collector depends on the custom resource for target discovery, the Pod depends on exposing a reachable metrics port and path, and Monarch depends on the collector for delivery before the series becomes globally queryable.
Exam tip: PodMonitoring scrapes only its own namespace, while ClusterPodMonitoring scrapes all namespaces; deploy PodMonitoring per namespace when cluster-wide collection is not intended.
OpenTelemetry instrumentation uses language SDKs in the application to emit detailed metrics and an OpenTelemetry Collector to route them to GMP. The SDK generates high-cardinality series with attributes such as HTTP route, tenant, or revision, the collector's Prometheus receiver scrapes Prometheus exporters or receives OTLP push traffic, and the googlemanagedprometheus exporter forwards the result to Monarch. This path supports push-based collection from short-lived or stateless workloads, preserves exemplars that link metrics to traces, and lets one collector carry metrics, logs, and traces to their respective backends.
Collector configuration for Kubernetes application identity relies on processors that attach resource metadata before export. The k8sattributes processor extracts metadata such as namespace from the environment, the transform/collision processor sets project_id, location, cluster, and namespace attributes, and the transform/aco-gke processor populates top_level_controller_name and top_level_controller_type labels. On Google Kubernetes Engine (GKE) clusters at version 1.32.1-gke.1439000 or later, GMP discovers those controller labels through Prometheus service-discovery metadata and, together with App Hub registration, Google Cloud Observability attaches application labels to the ingested series. For Cloud Run, the workload uses either the Prometheus sidecar for Prometheus-format metrics or the OpenTelemetry sidecar for OTLP metrics, then registers the service with App Hub so the same application attribution applies.
Targeted collection workflow configures GMP to ingest only specific emitted metrics instead of enabling a full built-in metrics package. Built-in GKE packages already ingest curated sets for system components, control plane, kube-state, cAdvisor and kubelet, and NVIDIA DCGM, so custom scraping is used to monitor a specific signal, to replace an unneeded package with a cheaper subset, or to collect an emitted metric that no package includes. If a custom relabeling rule keeps a metric that is also active in a package, such as kubelet_running_containers while the KUBELET package is enabled, Monarch receives duplicate series.
To configure a specific metric without duplication, follow the documented order:
kubelet_working_pods and its endpoint such as /metrics or /metrics/cadvisor in component or cAdvisor reference docs.gcloud container clusters describe with the monitoring component fields to see enabled packages such as SYSTEM_COMPONENTS, CADVISOR, KUBELET, or DCGM.kubectl get --raw "/api/v1/nodes/NODE_NAME/proxy/metrics" and confirm the metric lines appear with HELP, TYPE, and samples.This order matters because package state determines whether custom scraping will duplicate data, endpoint verification confirms the target actually exposes the series, and the custom resource only takes effect after it is applied to the correct scope. First the source must expose the metric, then the operator must select it, then Monarch must receive it before PromQL, alerting, or Grafana can use it globally.
PodMonitoring scrapes only Pods in the namespace where the PodMonitoring object is deployed, while ClusterPodMonitoring scrapes matching Pods in any namespace from a single cluster-scoped object. To cover multiple namespaces with PodMonitoring you must deploy the same manifest in each namespace, whereas one ClusterPodMonitoring object provides cluster-wide collection.
Use the Ops Agent for third-party telemetry on Compute Engine virtual machines, use Google Cloud Managed Service for Prometheus for third-party telemetry on Google Kubernetes Engine (GKE), and use BindPlane to bring on-premises and hybrid-cloud metrics into the same Cloud Monitoring store. Both the Ops Agent and GMP pipelines land in the same Monitoring backend where the same alerting, charting, and dashboard services apply, and ingested BindPlane series are subject to the same project metrics scope, PromQL querying, dashboards, and alerting policies.
Monarch is the central storage and query layer behind Cloud Monitoring and Google Cloud Managed Service for Prometheus that retains Prometheus data for 24 months and evaluates PromQL across all regions and up to 3,500 Google Cloud projects in a metrics scope. Distributed collectors forward data to Monarch so a single Grafana instance, Metrics Explorer chart, or alerting policy can query that global store with PromQL instead of connecting to individual Prometheus servers, while a project metrics scope controls which stored time series can be charted or monitored.
Envoy proxies export logs about every 10 seconds and export metrics and topology edges about every 1 minute, with full topology reports about every 10 minutes. Traces are exported according to configured sampling, typically 1 out of every 100 requests, and full telemetry can be delayed 1 to 2 minutes while clusters start.
Your enterprise operates a hybrid cloud architecture comprising Google Cloud workloads and critical on-premises database clusters (such as Cassandra and Elasticsearch). You have been tasked with centralizing infrastructure and database metrics into Google Cloud Monitoring without modifying underlying application code.
After deploying BindPlane to collect telemetry from your on-premises servers, you observe that the volume of ingested metric data in Cloud Monitoring is exceeding budget thresholds. Your monitoring policy only requires performance metrics at a 5-minute granularity for standard operational dashboards, and several default component metrics are unnecessary for your operational alerting.
What should you do to optimize your hybrid metric pipeline and reduce ingestion costs?
Last updated