Valutare i carichi di lavoro utilizzando regole personalizzate
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo documento descrive come utilizzare le regole personalizzate in Workload Manager per valutare
i tuoi carichi di lavoro in base alle best practice consigliate per la tua organizzazione.
Nella tabella Regole, seleziona le regole personalizzate per le quali vuoi convalidare le risorse selezionate.
Nel riquadro Ambito e filtri, seleziona le risorse che vuoi
includere nella valutazione.
Fai clic su Sfoglia ambiti e seleziona le organizzazioni, le cartelle o i progetti
in cui vuoi eseguire la valutazione.
(Facoltativo) Nella sezione Applica filtri alle risorse, utilizza i filtri
per selezionare solo risorse specifiche.
Nella sezione Località per i dati di valutazione, seleziona le regioni
in cui vuoi che Workload Manager memorizzi i dati di valutazione.
Fai clic su Continua.
Nella sezione Frequenza e notifiche, segui questi passaggi:
(Facoltativo) Per esportare i risultati della valutazione in un set di dati BigQuery,
seleziona Salva nel set di dati BigQuery e poi
specifica il nome del set di dati.
(Facoltativo) Per creare una tabella separata per ogni valutazione, fai clic su Crea una nuova tabella dei risultati per questa valutazione.
Nella pagina Informazioni sulla valutazione, fai clic su Esegui. La valutazione del carico di lavoro
richiede alcuni minuti. Alcune valutazioni potrebbero non essere
completamente in tempo reale a causa del tempo necessario per il completamento di una valutazione.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)."]]