VOOZH about

URL: https://docs.datadoghq.com/internal_developer_portal/scorecards/custom_rules/

⇱ Custom rules


For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/internal_developer_portal/scorecards/custom_rules.md. A documentation index is available at /llms.txt.
This product is not supported for your selected Datadog site. ().

Custom rules allow you to codify your organizations’ expectations about your software components, teams, and more. You decide the evaluation criteria, frequency, and data input. You can create custom rules through the Scorecards API or through Datadog Workflow Automation. If you are not familiar with the Workflow Automation product, you can start building your first custom Scorecards rule with AI.

Create custom rules

To add and evaluate custom rules using the Scorecards API:

  1. Specify the name of the rule, the scorecard it belongs to, a rule description, and an owner to pass to /scorecard/rules.
  2. Send an outcome of pass, fail, or skip for each {rule, entity} tuple that you are evaluating to /scorecard/outcomes/batch.
  3. View an overview of outcomes and remarks in the Scorecards dashboard.

After initial setup, rules can also be enabled or disabled through the API.

To evaluate and add custom rules in the Scorecards UI:

  1. Click Create Rule on the Scorecards page.
  2. Specify the name of the rule, the scorecard it belongs to, a rule description, the owning team, which level the rule belongs to, and a scope, if necessary.
  3. Navigate to the rule you created and select Edit Outcome next to the entity that you want to evaluate.
  4. Select the relevant outcome of pass, fail, or skip and add an optional remark describing the reason for the outcome.
  5. View an overview of outcomes and remarks in the Scorecards dashboard.

Evaluate custom rules using Workflow Automation

Workflow Automation allows you to automate the evaluation of your custom rules in Datadog using the Update scorecard rule outcome action.

When you create a custom rule, you can evaluate it using one of the following options:

Create workflow

After creating your custom rule, choose the Add Workflow option when prompted to configure its evaluation criteria. From there, you can create a workflow from scratch or use a blueprint.

After the workflow is created, it is automatically linked to the Scorecard rule. Click the link to open the workflow, make changes, and view details such as the owner, run history, and last modified date.

All Workflows created from the Scorecards page or from a Scorecards blueprint are automatically tagged with source: scorecards for searching and filtering.

Note: Clicking the red unlink button on a Scorecard rule removes the workflow from the rule but does not automatically unpublish the workflow. To prevent evaluations from running, you should also unpublish any unlinked workflows.

Link existing workflow

After creating your custom rule, choose the Add Workflow option to configure its evaluation criteria. Search for and select an existing workflow to link to the rule.

You can also link an existing workflow to any custom rule that already generates outcomes:

  1. Click the custom rule.
  2. Select Link Workflow.
  3. Search for a workflow and select it to link it to the rule.

Further reading