Warning
Deprecated: Datadog Quality Gates is being replaced by the new PR Gates in 2026. To start the migration, please fill out this form: https://forms.gle/qnhANsE1ABtHrjqz9
Learn more about PR Gates: https://docs.datadoghq.com/pr_gates
Evaluate Quality Gates rules in Datadog. The exit status of the command will change depending on the result of the gate evaluation.
The evaluate command evaluates the matching Quality Gates rules in Datadog.
datadog-ci gate evaluate [--scope] [--tags] [--dry-run] [--fail-if-unavailable] [--fail-on-empty] [--no-wait]For example:
datadog-ci gate evaluate --scope team:backend --scope team:frontend --fail-on-empty--scopeis an array of key value pairs of the formkey:value. This parameter sets additional scope when retrieving matching rules. Only the rules matching the scope provided will be evaluated.--tagsis an array of key value pairs of the formkey:value. This parameter sets global tags that are applied to all results. The upload process merges the tags passed on the command line with the tags in theDD_TAGSenvironment variable. If a key appears in both--tagsandDD_TAGS, the value inDD_TAGStakes precedence.--dry-runruns the command without the final evaluation step. All other checks are performed. The default value isfalse.--fail-if-unavailablefails the command if Datadog is unavailable. The default value isfalse.--fail-on-emptyfails the command if no matching rules are found in Datadog. The default value isfalse.--timeoutis the command timeout in seconds. The default value is600.--no-waitremoves the waiting time (30s) that is in place to ensure that events (for example: tests) can be properly queried by the rules. This mechanism prevents rules from being incorrectly evaluated due to the absence of events. Read more on the quality gates documentation before passing this flag. The default value isfalse.
Additionally, you can configure the gate command with the following environment variables:
DD_API_KEY(required): The API key used to authenticate the requests.DD_APP_KEY(required): The application key used to authenticate the requests.DD_TAGS: Sets global tags applied to all spans. The format must bekey1:value1,key2:value2. The upload process merges the tags passed on the command line with the tags in the--tagsparameter. If a key appears in both--tagsandDD_TAGS, the value inDD_TAGStakes precedence.DD_SITE: Your Datadog site, for example, datadoghq.com or datadoghq.eu.
gitis used for extracting repository metadata.
To verify the command works as expected, use --dry-run:
export DD_API_KEY='<API key>'
export DD_APP_KEY='<App key>'
yarn launch gate evaluate --scope team:backend --dry-runSuccessful output looks like the example below:
ℹ️ Evaluating rules matching the following information:
Repository: git@github.com:DataDog/datadog-ci.git
Branch: master
team: backend
Dry run mode is enabled. Not evaluating the rules.Additional helpful documentation, links, and articles: