이 페이지에서는 요청 수 및 지연 시간 등 Cloud EKM 키 및 외부 키 관리자 연결과 관련된 측정항목을 추적하는 대시보드를 만드는 방법을 보여줍니다. 이러한 측정항목에 대한 자세한 내용은 cloudkms metrics를 참조하세요. 다음 섹션에 설명된 대시보드 생성 프로세스에 대한 자세한 내용은 API로 대시보드 관리를 참조하세요.
시작하기 전에
이 페이지의 안내에서는 다음을 가정합니다.
EKM 연결 한 개, 외부 키 한 개 이상을 포함하여 프로젝트에 설정된 Cloud EKM이 있습니다.
필요한 역할
gcloud CLI를 사용하여 대시보드를 만드는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 다음 IAM 역할을 부여해 달라고 요청하세요.
[[["이해하기 쉬움","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-04(UTC)"],[],[],null,["# Monitor EKM usage\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nYou can use Cloud Monitoring to monitor your external key manager (EKM)\nconnection. The following metrics can help you understand your EKM usage:\n\n- `cloudkms.googleapis.com/ekm/external/request_latencies`\n- `cloudkms.googleapis.com/ekm/external/request_count`\n\nThis page shows you how to create a dashboard to track metrics related to your\nCloud EKM keys and external key manager connection, such as request\ncounts and latencies. For more information about these metrics, see\n[cloudkms metrics](/monitoring/api/metrics_gcp_c#gcp-cloudkms). For more\ninformation about the dashboard creation process described in the following\nsections, see\n[Managing dashboards by API](/monitoring/dashboards/api-dashboard).\n\nBefore you begin\n----------------\n\nThe steps on this page assume the following:\n\n- You already have Cloud EKM set up in a project, including an [EKM connection](/kms/docs/create-ekm-connection) and one or more [external keys](/kms/docs/create-external-key).\n\n### Required roles\n\n\nTo get the permissions that\nyou need to create dashboards using the gcloud CLI,\n\nask your administrator to grant you the\nfollowing IAM roles on your project:\n\n- [Monitoring Dashboard Configuration Editor](/iam/docs/roles-permissions/monitoring#monitoring.dashboardEditor) (`roles/monitoring.dashboardEditor`)\n- [Service Usage Consumer](/iam/docs/roles-permissions/serviceusage#serviceusage.serviceUsageConsumer) (`roles/serviceusage.serviceUsageConsumer`)\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThese predefined roles contain\n\nthe permissions required to create dashboards using the gcloud CLI. To see the exact permissions that are\nrequired, expand the **Required permissions** section:\n\n\n#### Required permissions\n\nThe following permissions are required to create dashboards using the gcloud CLI:\n\n- ` monitoring.dashboards.create `\n- ` monitoring.dashboards.delete `\n- ` monitoring.dashboards.update `\n- ` serviceusage.services.use`\n\n\nYou might also be able to get\nthese permissions\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nCreate a dashboard to monitor your EKM\n--------------------------------------\n\nTo monitor the status of your EKM, create a dashboard that monitors your\nrequest count and latencies:\n\n1. Download the dashboard configuration:\n [`ekm-dashboard.json`](/static/kms/static/ekm-dashboard.json).\n\n2. Create a custom dashboard with the configuration file by running the\n following command:\n\n ```\n gcloud monitoring dashboards create \\\n --config-from-file=ekm-dashboard.json\n ```\n\nView your EKM dashboard\n-----------------------\n\n1. In the Google Cloud console, go to the **Monitoring** page, or use the\n following button:\n\n [Go to Monitoring](https://console.cloud.google.com/monitoring)\n2. Select **Resources \\\u003e Dashboards** and view the dashboard\n named **Cloud KMS EKM**.\n\nCreate an alert policy for EKM metrics\n--------------------------------------\n\nComplete the following steps using the gcloud CLI:\n\n1. Select a notification channel to receive EKM metrics alerts.\n\n - To use an existing notification channel, first view your channels:\n\n ```\n gcloud beta monitoring channels list\n ```\n\n Choose a channel from the list. Make note of the notification channel\n ID; you need it later.\n - To use a new notification channel, create the channel using an email\n address:\n\n ```\n gcloud beta monitoring channels create \\\n --display-name=\"Notification channel for EKM latency alert\" \\\n --description=\"This notification channel receives EKM latency metric alerts\" \\\n --type=email \\\n --channel-labels=email_address=NOTIFICATION_EMAIL\n ```\n\n If successful, this command returns the name of the new channel. Make\n note of the notification channel ID; you need it later. The output is\n similar to the following: \n\n ```\n Created notification channel [projects/PROJECT_ID/notificationChannels/NOTIFICATION_CHANNEL_ID]\n ```\n2. Create an alerting policy using the [`monitoring policies\n create`](/sdk/gcloud/reference/alpha/monitoring/policies/create) command:\n\n gcloud alpha monitoring policies create \\\n --notification-channels=\u003cvar translate=\"no\"\u003eNOTIFICATION_CHANNEL_ID\u003c/var\u003e \\\n --aggregation=' {\"alignmentPeriod\": \"60s\",\"perSeriesAligner\": \"ALIGN_PERCENTILE_99\"}' \\\n --condition-display-name=\"EKM Request Latency \u003e 150ms\" \\\n --condition-filter='resource.type=\"cloudkms.googleapis.com/Project\"\n metric.type=\"cloudkms.googleapis.com/ekm/external/request_latencies\"\n metric.labels.ekm_service_region=\"\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\"\n metric.labels.method=\"\u003cvar translate=\"no\"\u003eLABEL_METHOD\u003c/var\u003e\"' \\\n --duration=\"0s\" \\\n --if=\"\u003e 150\" \\\n --display-name=\"EKM metric latency alert\" \\\n --trigger-count=1 \\\n --combiner='AND'\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNOTIFICATION_CHANNEL_ID\u003c/var\u003e: the ID of the notification channel.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the region for which you want to alert on this metric. If you want to alert regardless of region, omit `metric.labels.ekm_service_region`.\n - \u003cvar translate=\"no\"\u003eLABEL_METHOD\u003c/var\u003e: the `method` label that you want to alert on---for example, `wrap`, `unwrap`, `asymmetricSign`, `checkCryptoSpacePermissions`, `createKey`, `getInfo`, or `getPublicKey`. You can use **Metrics Explorer** to explore metric labels.\n\nWhat's next\n-----------\n\n- [Explore your data across various metric dimensions using\n Metrics Explorer](/monitoring/charts/metrics-explorer).\n- Optional: Create [alerting policies](/monitoring/alerts)."]]