[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# About custom rules in Workload Manager\n\nWorkload Manager supports using customized rules that help you\nvalidate your workloads against best practices recommended by your organization.\n\nFor example, to ensure that the virtual machines (VMs) in your deployment\ndon't use the Compute Engine default service account, you can create a custom\nrule. After you create the rule, create and run an evaluation in Workload Manager\nto validate your workloads against the rule. You can then review the evaluation results and take\nremediation steps for any violation of these rules. This helps improve the\nquality, reliability, and performance of your deployments.\n\n\u003cbr /\u003e\n\nHow it works\n------------\n\nTo evaluate workloads using custom rules, do the following:\n\n1. Identify the best practices relevant to your deployments from [Google Cloud Well-Architected Framework](/architecture/framework).\n2. [Create custom rules using Rego](/workload-manager/docs/evaluate/custom-rules/rego-custom-rules).\n3. [Create and schedule evaluations for your workloads](/workload-manager/docs/create-evaluation).\n4. Optional: Export evaluation results to BigQuery and set up notifications.\n\nThe following figure summarizes the process of using custom rules in Workload Manager:\n\nLimitations\n-----------\n\nThe following limitations apply to custom rules in Workload Manager:\n\n- You can include a maximum of 300 rules per evaluation in Workload Manager. More number of rules can slow down the evaluation process. We recommend that you split your rules across multiple evaluations.\n- Workload Manager does not support exporting evaluation results to multi-regional BigQuery datasets. You can export evaluation results to regional BigQuery datasets.\n\nSupported data sources\n----------------------\n\nWorkload Manager uses data from the following services to scan\nthe resources that you specified for evaluation:\n\n- Cloud Asset Inventory: For a complete list of supported resource types in Cloud Asset Inventory, see [Supported asset types](/asset-inventory/docs/supported-asset-types)\n- Cloud Monitoring metrics. See [Supported metrics for Compute Engine](#compute-metrics).\n\n### Supported metrics for Compute Engine\n\nThe following table lists the metrics supported for Compute Engine. For more\ninformation about these metrics, see [Cloud Monitoring metrics](/monitoring/api/metrics_gcp_c#gcp-compute).\n\nThe \"Metric type\" strings in this table must be prefixed with `compute.googleapis.com`.\nThat prefix has been omitted from the entries in the table. \n\nPricing\n-------\n\nFor pricing information, see [Workload Manager Pricing](/workload-manager/pricing).\n\nWhat's next\n-----------\n\n- [Write custom rules using Rego](/workload-manager/docs/evaluate/custom-rules/rego-custom-rules)\n- [Create and run an evaluation](/workload-manager/docs/create-evaluation)"]]