Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Puedes usar Cloud Monitoring para supervisar tu conexión del administrador de claves externas (EKM). Las siguientes métricas pueden ayudarte a comprender el uso de tu EKM:
En esta página, se muestra cómo crear un panel para hacer un seguimiento de las métricas relacionadas con tus claves de Cloud EKM y la conexión del administrador de claves externo, como los recuentos de solicitudes y las latencias. Para obtener más información sobre estas métricas, consulta Métricas de Cloud KMS. Para obtener más información sobre el proceso de creación de paneles que se describe en las siguientes secciones, consulta Administra paneles con la API.
Antes de comenzar
En los pasos de esta página, se supone lo siguiente:
Para obtener los permisos que necesitas para crear paneles con gcloud CLI, pídele a tu administrador que te otorgue los siguientes roles de IAM en tu proyecto:
Estos roles predefinidos contienen los permisos necesarios para crear paneles con gcloud CLI. Para ver los permisos exactos que son necesarios, expande la sección Permisos requeridos:
Permisos necesarios
Se requieren los siguientes permisos para crear paneles con gcloud CLI:
Si funciona, este comando muestra el nombre del canal nuevo. Toma nota del ID del canal de notificación, ya que lo necesitarás más adelante. La salida es similar a lo siguiente:
Created notification channel [projects/PROJECT_ID/notificationChannels/NOTIFICATION_CHANNEL_ID]
NOTIFICATION_CHANNEL_ID: Es el ID del canal de notificación.
LOCATION: Es la región para la que deseas generar alertas sobre esta métrica. Si quieres enviar alertas independientemente de la región, omite metric.labels.ekm_service_region.
LABEL_METHOD: Es la etiqueta de method sobre la que deseas generar una alerta, por ejemplo, wrap, unwrap, asymmetricSign, checkCryptoSpacePermissions, createKey, getInfo o getPublicKey. Puedes usar el Explorador de métricas para explorar las etiquetas de métricas.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-02 (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)."]]