이 페이지에서는 GKE 연결 클러스터에 대한 Google Cloud Managed Service for Prometheus를 사용하여 관리형 데이터 수집을 설정하는 방법을 설명합니다. 이 기능은 Kubernetes 버전 1.25 이상을 실행하는 Google Cloud 클러스터에서 사용할 수 있습니다. 이 기능은 이전에 해당 버전에서 이 기능의 미리보기를 등록한 고객 버전 1.24의 Kubernetes 클러스터에서도 지원됩니다.
이 기능을 사용하면 PodMonitoring 리소스를 사용하여 Cloud Monitoring에 수집할 측정항목을 선택할 수 있습니다. 그런 다음 Google Cloud 콘솔에서 이러한 측정항목을 볼 수 있습니다.
제한사항
이 기능은 1.23.0-gke.2 이전 플랫폼 버전에서 사용할 수 없습니다.
이 기능에는 Linux 워크로드가 필요합니다.
관리형 데이터 수집 설정
Managed Service for Prometheus로 관리형 데이터 수집을 설정하려면 다음 단계를 완료하세요.
측정항목을 작성할 수 있도록 gmp-system/collector 및 gmp-system/rule-evaluator 서비스 계정을 승인합니다.
Managed Service for Prometheus로 관리형 데이터 수집을 사용 설정하면 GKE 연결 클러스터가 gmp-system 네임스페이스를 만듭니다. 이 네임스페이스에서는 수정하거나 배포하지 마세요.
GKE 연결 클러스터도 gmp-public 네임스페이스를 만듭니다. Managed Service for Prometheus는 gmp-public 네임스페이스를 사용하여 OperatorConfig 리소스를 배포합니다.
Prometheus 구성 업데이트
Prometheus 데이터 수집을 사용 중지하거나 다시 사용 설정하려면 gcloud container attached clusters update 명령어를 사용합니다. 클러스터를 업데이트할 때 --disable-managed-prometheus 또는 --enable-managed-prometheus 선택적 플래그를 포함합니다.
다음 단계
Managed Service for Prometheus로 관리형 데이터 수집 문서에서 쿼리 사용자 인터페이스 구성 방법 알아보기
Google Cloud Managed Service for Prometheus 문서에서 관리형 규칙 평가 및 알림 알아보기
[[["이해하기 쉬움","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-07-31(UTC)"],[],[],null,["This page explains how you can set up managed data collection with\n[Google Cloud Managed Service for Prometheus](/stackdriver/docs/managed-prometheus) for\nGKE attached clusters. This feature is available on Google Cloud clusters\nrunning Kubernetes version 1.25 or later. It is also supported on Kubernetes\nclusters at version 1.24 for customers who had earlier signed up for a\npreview of this feature on that version.\n\nWith this feature, you can use a PodMonitoring resource to choose the metrics\nthat you want to ingest into Cloud Monitoring. You can then view these\nmetrics in the Google Cloud console.\n\nLimitations\n\n- This feature is not available on platform versions earlier than 1.23.0-gke.2\n\n\u003c!-- --\u003e\n\n- This feature requires a Linux workload.\n\nSet up managed data collection\n\nTo set up managed data collection with Managed Service for Prometheus, complete the following steps:\n| **Note:** Starting with Kubernetes version 1.28, manual policy binding to authorize service accounts for data collection is no longer necessary. The required permissions are now automatically granted to this service account. You can therefore disregard step 1 in this section.\n\n1. Authorize the `gmp-system/collector` and `gmp-system/rule-evaluator` service\n accounts to write your metrics:\n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003eGOOGLE_PROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:\u003cvar translate=\"no\"\u003eGOOGLE_PROJECT_ID\u003c/var\u003e.svc.id.goog[gmp-system/collector]\" \\\n --role=roles/monitoring.metricWriter\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003eGOOGLE_PROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:\u003cvar translate=\"no\"\u003eGOOGLE_PROJECT_ID\u003c/var\u003e.svc.id.goog[gmp-system/rule-evaluator]\" \\\n --role=roles/monitoring.viewer\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003eGOOGLE_PROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:\u003cvar translate=\"no\"\u003eGOOGLE_PROJECT_ID\u003c/var\u003e.svc.id.goog[gmp-system/rule-evaluator]\" \\\n --role=roles/monitoring.metricWriter\n\n Replace \u003cvar translate=\"no\"\u003eGOOGLE_PROJECT_ID\u003c/var\u003e with your Google Cloud\n project ID.\n\n Adding this IAM binding fails unless at least one\n cluster has been created in your Google Cloud project. This is because the\n workload identity pool it refers to\n (\u003cvar translate=\"no\"\u003eGOOGLE_PROJECT_ID\u003c/var\u003e`.svc.id.goog`) isn't provisioned until\n cluster creation.\n2. Use the\n [`gcloud container attached clusters register` command](/sdk/gcloud/reference/container/attached/clusters/register)\n to register the cluster, and include the optional\n `--enable-managed-prometheus` flag.\n\n3. To configure which workload metrics you want to ingest, set up a\n [PodMonitoring](https://github.com/GoogleCloudPlatform/prometheus-engine/blob/v0.4.3-gke.0/doc/api.md#podmonitoring)\n resource. For an example, see\n [Configure a PodMonitoring resource](/stackdriver/docs/managed-prometheus/setup-managed#gmp-pod-monitoring)\n in the managed data collection with Managed Service for Prometheus documentation.\n\nAfter you enable managed data collection with Managed Service for Prometheus, GKE attached clusters creates the\n`gmp-system` namespace. Don't modify or deploy anything in this namespace.\nGKE attached clusters also creates the `gmp-public` namespace. Managed Service\nfor Prometheus uses the `gmp-public` namespace to deploy the\n[OperatorConfig](https://github.com/GoogleCloudPlatform/prometheus-engine/blob/v0.4.3-gke.0/doc/api.md#operatorconfig)\nresource.\n\nUpdate your Prometheus configuration\n\nTo disable or re-enable Prometheus data collection, use the\n[`gcloud container attached clusters update` command](/sdk/gcloud/reference/container/attached/clusters/update). When updating the cluster, include either the\n`--disable-managed-prometheus` or `--enable-managed-prometheus` optional flag.\n\nWhat's next\n\n- Discover how to [Configure a query user interface](/stackdriver/docs/managed-prometheus/query) in the managed data collection with Managed Service for Prometheus documentation.\n- Learn about [Managed rule evaluation and alerting](/stackdriver/docs/managed-prometheus/rules-managed) in the Google Cloud Managed Service for Prometheus documentation."]]