Evalúa tus cargas de trabajo con reglas personalizadas
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En este documento, se describe cómo usar reglas personalizadas en el Administrador de cargas de trabajo para evaluar tus cargas de trabajo en función de las prácticas recomendadas para tu organización.
En la tabla de reglas, selecciona las reglas personalizadas con las que deseas validar los recursos seleccionados.
En el panel Alcance y filtros, selecciona los recursos que deseas incluir en la evaluación.
Haz clic en Explorar los alcances y selecciona las organizaciones, las carpetas o los proyectos en los que deseas ejecutar la evaluación.
Opcional: En la sección Aplicar filtros a los recursos, usa filtros para seleccionar solo recursos específicos.
En la sección Ubicación de los datos de evaluación, selecciona las regiones en las que deseas que Workload Manager almacene los datos de evaluación.
Haz clic en Continuar.
En la sección Frecuencia y notificación, haz lo siguiente:
Opcional: Para exportar los resultados de la evaluación a un conjunto de datos de BigQuery, selecciona Guardar en el conjunto de datos de BigQuery y, luego, especifica el nombre del conjunto de datos.
Opcional: Para crear una tabla separada para cada evaluación, haz clic en Crear una tabla de resultados nueva para esta evaluación.
En la página Información de la evaluación, haz clic en Ejecutar. Una evaluación de la carga de trabajo tarda unos minutos en completarse. Es posible que haya evaluaciones que no son del todo en tiempo real debido al tiempo que lleva completar una evaluación.
[[["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-04 (UTC)"],[],[],null,["# Evaluate your workloads using custom rules\n\nThis document describes how to use custom rules in Workload Manager to evaluate\nyour workloads against best practices recommended for your organization.\n\nFor more information, see [About custom rules in Workload Manager](/workload-manager/docs/evaluate/custom-rules/about-custom-rules).\n\nBefore you begin\n----------------\n\n- [Create custom rules using Rego](/workload-manager/docs/evaluate/custom-rules/rego-custom-rules) and upload rules to a Cloud Storage bucket.\n- Enable the following APIs in your Google Cloud project where you create and run the evaluation:\n - Service Usage API\n - Cloud Monitoring API\n\n### Required roles\n\nFor more information about the required IAM roles, see [required permissions\nto create and run an evaluation](/workload-manager/docs/roles#summary_of_required_permissions_to_create_and_run_an_evaluation).\n\nEvaluate workloads using custom rules\n-------------------------------------\n\nTo create a workload evaluation using custom rules, follow these steps:\n\n1. In the Google Cloud console, go to the **Workload Manager** page.\n\n Go to [Workload Manager](https://console.cloud.google.com/workload-manager)\n2. Select a Google Cloud project.\n\n3. If prompted, to enable the required API for Workload Manager, click **Enable**.\n\n4. Click add**New evaluation**.\n\n5. In the **Evaluation details** section, do the following:\n\n 1. For **Evaluation name**, enter a name for the workload evaluation.\n 2. For **Workload type** , select **Custom**.\n 3. Select the Cloud Storage bucket containing the custom rules.\n\n You can use the sample rules available in the [GoogleCloudPlatform/workload-manager](https://github.com/GoogleCloudPlatform/workload-manager)\n GitHub repository or build your own rules and upload them to the Cloud Storage bucket.\n For more information, see [Write custom rules using Rego](/workload-manager/docs/evaluate/custom-rules/rego-custom-rules).\n 4. In the **Location for evaluation data** section, select the **Regions**\n where you want Workload Manager to store the evaluation data.\n\n 5. Optional: To export evaluation results to a BigQuery dataset,\n select **Save evaluation results to BigQuery dataset**, and then\n specify the name of the dataset.\n\n | **Note:** Ensure that the BigQuery dataset is regional. Workload Manager doesn't support exporting data to multi-region datasets. You must also create and use a dataset in the same region as the one you selected for evaluation in the previous step. If your organization uses a [Resource Location Restriction](/resource-manager/docs/organization-policy/defining-locations) policy, then create a BigQuery dataset in one of the allowed regions and [Workload Manager supported regions](/workload-manager/docs/evaluate/locations).\n 6. Optional: To create a separate table for each evaluation, click **Create a new results table for this evaluation**.\n\n 7. Optional: To encrypt evaluation data with customer-managed encryption keys (CMEK),\n click **Encryption** and provide an encryption key for each region. For more\n information, see [Enable customer-managed encryption keys for evaluations](/workload-manager/docs/evaluate/custom-rules/enable-cmek).\n\n6. Click **Continue**.\n\n7. In the **Evaluation scope** section, select the resources that you want to\n include in the evaluation.\n\n 1. Click **Browse scopes** and select the organizations, folders, or projects in which you want to run the evaluation.\n 2. Optional: In the **Apply filters to resources** section, use filters to only select specific resources.\n8. Click **Continue**.\n\n9. In the **Evaluation rules** section, select the custom rules you want to validate\n the selected resources against.\n\n10. In the **Scheduling** section, select the frequency at which you want the evaluation to run.\n\n11. Click **Continue**.\n\n12. In the **Notifications** section, select the notification channel and select\n the events for which you want to receive notifications.\n\n13. Click **Continue**.\n\n14. Review the evaluation settings, and then click **Create**.\n\nRun the evaluation\n------------------\n\nTo run a workload evaluation, follow these steps:\n\n1. In the Google Cloud console, go to the **Workload Manager** page.\n\n Go to [Workload Manager](https://console.cloud.google.com/workloads?walkthrough_id=workload-manager--create-evaluation).\n2. Click the **Evaluation name**.\n\n3. On the **Evaluation information** page, click **Run**. A workload evaluation\n takes a few minutes to complete. There might be evaluations that aren't\n completely real-time due to the time it takes for an evaluation to complete.\n\nWhat's next\n-----------\n\n- Learn more [about workload evaluations](/workload-manager/docs/about-evaluations)."]]