---
title: Deployment Gates
description: >-
  Reduce deployment incidents by evaluating monitors and Watchdog Faulty
  Deployment Detection during a rollout, so your pipeline can halt releases when
  regressions are detected.
breadcrumbs: Docs > Deployment Gates
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Deployment Gates

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

A Deployment Gate is an automated checkpoint between your deployment stages. During a production rollout, the gate checks service health using signals Datadog already collects. When a rule fails, the gate returns a failing verdict so your pipeline can pause the rollout. This helps keep errors and other issues from reaching a wider user base.

When a gate fails, the [Evaluations](https://app.datadoghq.com/ci/deployment-gates/evaluations) page shows the deployed version, the failed rules, and why each rule failed. You can follow the associated traces to start investigating the problem.

{% image
   source="https://docs.dd-static.net/images/deployment_gates/evaluations_rule_failure.e675c5439780c618c56924ff5e5a1701.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/deployment_gates/evaluations_rule_failure.e675c5439780c618c56924ff5e5a1701.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="The Deployment Gates Evaluations page with a side panel showing a failed monitor rule evaluation." /%}

For setup instructions, see [Set up Deployment Gates](https://docs.datadoghq.com/deployment_gates/setup.md).

## How Deployment Gates work{% #how-deployment-gates-work %}

A Deployment Gate evaluates one or more rules to decide whether a deployment should proceed. It is defined for a given service and environment.

After receiving a gate evaluation verdict, your deployment pipeline decides what to do next—for example, halting the deployment or performing a rollback.

### Where gate configurations are stored{% #where-gate-configurations-are-stored %}

A Deployment Gate configuration can be:

- **Inline**: The gate is defined in code alongside your deployment configuration. The gate configuration is sent with each evaluation request. There is no setup in Datadog.
  - To create an inline gate, see [Set Up Inline Deployment Gates](https://docs.datadoghq.com/deployment_gates/setup/inline.md).
- **Preconfigured**: The gate is created and stored in Datadog.
  - To create a preconfigured gate, see [Set Up Preconfigured Deployment Gates](https://docs.datadoghq.com/deployment_gates/setup/preconfigured.md).

## Rules{% #rules %}

There are two types of rules: monitor rules and Watchdog Faulty Deployment Detection rules. A single gate can combine multiple rules of different types.

Each rule watches health indicators for a configurable evaluation period of up to 2 hours.

To configure each rule type, see the Rules sections of [Set Up Inline Deployment Gates](https://docs.datadoghq.com/deployment_gates/setup/inline.md#rules) and [Set Up Preconfigured Deployment Gates](https://docs.datadoghq.com/deployment_gates/setup/preconfigured.md#rules).

### Monitor rules{% #monitor-rules %}

A monitor rule checks the state of one or more [monitors](https://docs.datadoghq.com/monitors.md) you have already set up in Datadog. Select monitors with either a search query or a list of specific monitors.

A monitor rule fails if any monitor it evaluates is in `ALERT` or `NO_DATA` state at any time during the evaluation period. It also fails if there's nothing to evaluate (for example, the query matches no monitors, or every matching monitor is muted), a specific monitor ID doesn't exist in your organization, or the rule includes more than 300 monitors.

{% collapsible-section #monitor-search-queries %}
#### Monitor search queries

Monitor search queries use the [Search Monitor syntax](https://docs.datadoghq.com/monitors/manage/search.md). You can filter on static tags (`service:transaction-backend`), tags in the monitor's query (`scope:"service:transaction-backend"`), or [monitor grouping](https://docs.datadoghq.com/monitors/manage.md#triggered-monitors) tags (`group:"service:transaction-backend"`).

{% alert level="info" %}
Static tag filters (such as `env` or `team`) and `scope` filters select which monitors to evaluate, including all of their groups. A `group` filter also limits evaluation to the matching groups in each monitor, so alerts on other groups don't fail the rule.
{% /alert %}

Example queries:

- `env:prod service:transaction-backend`

- `env:prod (service:transaction-backend OR group:"service:transaction-backend" OR scope:"service:transaction-backend")`

- `tag:"use_deployment_gates" team:payment`

- `tag:"use_deployment_gates" AND (NOT group:("team:frontend"))`

{% /collapsible-section %}
 
### Watchdog Faulty Deployment Detection rules{% #watchdog-faulty-deployment-detection-rules %}

A [Watchdog Faulty Deployment Detection](https://docs.datadoghq.com/watchdog/faulty_deployment_detection.md) (FDD) rule compares the deployed version against previous versions of the same service. The rule fails if the analysis detects new types of errors or significant increases in error rates on any [resource](https://docs.datadoghq.com/tracing/services/resource_page.md).

FDD rules support APM-instrumented services that set the `version` tag through [Unified Service Tagging](https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging.md). Services marked as `database` or `inferred service` are not supported. To scope the analysis, you can list resources to include or to exclude (such as low-priority endpoints).

The rule runs a separate analysis for each [additional primary tag](https://docs.datadoghq.com/tracing/guide/setting_primary_tags_to_scope.md?tab=helm#add-additional-primary-tags-in-datadog) value, plus an aggregate analysis. To analyze only one primary tag value, specify it as `primary_tag` in the evaluation request attributes.

## Evaluations{% #evaluations %}

An evaluation is a single run of a gate's rules against a specific deployment. Your pipeline requests a gate evaluation, and Datadog immediately returns an evaluation ID. The evaluation eventually resolves to `pass` or `fail`.

Evaluations for both inline and preconfigured gates appear on the [Evaluations](https://app.datadoghq.com/ci/deployment-gates/evaluations) page.

### Evaluation modes{% #evaluation-modes %}

There are two evaluation modes: dry run and active. You can set the evaluation mode separately on each gate and each rule. The mode determines whether their verdicts affect your deployment.

#### Dry run mode{% #dry-run-mode %}

Use dry run to see which deployments would pause and why, while deployments continue as usual.

The verdict of a gate in dry run mode is recorded on [Evaluations](https://app.datadoghq.com/ci/deployment-gates/evaluations) but doesn't affect your deployment. That is, a dry run gate always returns `pass` to your pipeline. A dry-run rule's verdict doesn't count toward its associated gate's verdict.

#### Active mode{% #active-mode %}

Use active mode when you're ready for your workflow to pause when a required check fails.

An active gate returns its true verdict (`pass` or `fail`) to your pipeline. An active rule's verdict counts toward the associated gate's verdict.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Set up Deployment Gates](https://docs.datadoghq.com/deployment_gates/setup.md)
- [Catch incidents and pause faulty deployments automatically with Deployment Gates](https://www.datadoghq.com/blog/deployment-gates/)
- [Learn about Continuous Delivery Visibility](https://docs.datadoghq.com/continuous_delivery.md)
- [Learn how to set up CD Visibility](https://docs.datadoghq.com/continuous_delivery/deployments.md)
- [Catch incidents and pause faulty deployments automatically with Datadog Deployment Gates](https://www.datadoghq.com/blog/deployment-gates/)
