Your GKE Standard cluster (version 1.25) runs several microservices that expose Prometheus-formatted metrics on the /metrics path. The SRE team wants to use Google Cloud Managed Service for Prometheus to query these metrics with PromQL in Cloud Monitoring, but they do not want to deploy or manage a Prometheus server in the cluster. What should you do to meet the requirement?
Run gcloud container clusters update CLUSTER_NAME --managed-prometheus to enable managed collection, then add a PodMonitoring resource for the /metrics endpoint.
Create a PodMonitoring (or ServiceMonitoring) resource that defines the scrape configuration for the /metrics endpoint; managed collection, enabled by default on your cluster, will handle the scraping and export.
Deploy the kube-prometheus-stack Helm chart to install Prometheus and Grafana in the cluster, and configure PrometheusRule CRDs for scrapes.
Install the Google Ops Agent on each node VM and configure it to forward Prometheus metrics to Cloud Monitoring.
In GKE versions 1.21 and later, Managed Service for Prometheus's managed collection mode is enabled by default. Therefore, you only need to declare a PodMonitoring (or ServiceMonitoring) custom resource that specifies how to scrape the application's /metrics endpoint. The managed collectors already running in the cluster will discover the targets, scrape the metrics, and write them to Managed Service for Prometheus, where they are queryable with PromQL in Cloud Monitoring. Deploying a full Prometheus stack, installing Ops Agent, or merely enabling the Prometheus API without configuring collection would not satisfy the requirement to avoid operating your own Prometheus server.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Google Cloud Managed Service for Prometheus?
Open an interactive chat with Bash
What is the purpose of PodMonitoring or ServiceMonitoring resources in GKE?
Open an interactive chat with Bash
What is 'managed collection' in Google Cloud Managed Service for Prometheus?
Open an interactive chat with Bash
What is PodMonitoring in GKE?
Open an interactive chat with Bash
What is Google Cloud Managed Service for Prometheus?
Open an interactive chat with Bash
What is PromQL and how is it used in Cloud Monitoring?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Ensuring successful operation of a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .