---
title: Monitor CI Providers Deployments
description: Learn how to monitor deployments from CI Providers in Datadog CD Visibility.
breadcrumbs: >-
  Docs > Continuous Delivery Visibility > CD Visibility in Datadog > Monitor CI
  Providers Deployments
---

# Monitor CI Providers Deployments

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

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

{% /callout %}

{% callout %}
##### Join the Preview!

CD Visibility for CI provider deployments is in Preview. If you're interested in this feature, complete the form to request access.

[Request Access](https://docs.google.com/forms/d/e/1FAIpQLScNhFEUOndGHwBennvUp6-XoA9luTc27XBwtSgXhycBVFM9yA/viewform?usp=sf_link)
{% /callout %}

## Overview{% #overview %}

[Deployments](https://docs.datadoghq.com/continuous_delivery/deployments.md) can be performed in your continuous integration (CI) pipelines. Typically, these pipelines have a deployment step that is executed after the source code is tested and the image is built.

If you are executing deployments using a CI provider, you can monitor your deployments with Deployment Visibility. Ensure the following requirements are met:

1. You are using [Pipeline Visibility](https://docs.datadoghq.com/continuous_integration/pipelines.md) to monitor your CI pipelines.
1. Your CI provider supports the **Custom tags and measures at runtime** feature, which allows you to add [user-defined text and numerical tags](https://docs.datadoghq.com/continuous_integration/pipelines/custom_tags_and_measures.md) to pipelines and jobs in Pipeline Visibility.
1. You are executing deployments in a CI job (or a [related level](https://docs.datadoghq.com/continuous_integration/pipelines.md#terminology) in your CI provider). The concept of a CI job may vary depending on your provider. For more information about how Datadog defines a CI job, see the [Terminology section](https://docs.datadoghq.com/continuous_integration/pipelines.md#terminology).

## Setup{% #setup %}

{% alert level="info" %}
The setup requires the [`datadog-ci` CLI ](https://www.npmjs.com/package/@datadog/datadog-ci)version `2.26.0` or later.
{% /alert %}

To set up CD Visibility, use the `datadog-ci deployment mark` command inside the CI job that is performing the deployment.

Two environment variables are required:

1. `DD_API_KEY`: Point to your [Datadog API key](https://app.datadoghq.com/organization-settings/api-keys).
1. `DD_BETA_COMMANDS_ENABLED`: Set to 1.

Optionally, you can set `DD_SITE` environment variable to a specific [Datadog site](https://docs.datadoghq.com/getting_started/site.md). Your site is .

You can enrich the deployment event that is generated by the `datadog-ci deployment mark` command using the following parameters:

| Parameter       | Description                                                                                                                             |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `--env`         | The environment to which this deployment is performed. For example, `prod`.                                                             |
| `--service`     | The name of the service being deployed. For example, `transaction-service`. This option requires `datadog-ci` version `2.31.1` or later |
| `--revision`    | The revision or version that is being deployed. For example, `1.0.0` or `v123-456`.                                                     |
| `--is-rollback` | Specifies that the deployment is a rollback.                                                                                            |
| `--tags`        | An array of key-value pairs in the `key:value` format. These tags are added to the deployment event shown in Datadog.                   |

Use `--no-fail` (default: `false`) to prevent the deployment command from failing if there are issues submitting the data.

If you are using GitHub Actions as your CI provider, see the [section below](https://docs.datadoghq.com/continuous_delivery/deployments/ciproviders.md#mark-github-actions-jobs-as-deployments) for additional considerations.

Once you have added the command to a CI job, the [**Deployments** page](https://app.datadoghq.com/ci/deployments) and the [Deployment Executions page](https://app.datadoghq.com/ci/deployments/executions) populates with data after pipelines are executed. For more information, see [Explore CD Visibility Deployments](https://docs.datadoghq.com/continuous_delivery/explorer.md).

### Examples{% #examples %}

This set of commands specifies that the CI job executes a deployment to the `prod` environment with version `1.0.0`:

```shell
export DD_BETA_COMMANDS_ENABLED=1
export DD_API_KEY="<YOUR_API_KEY>"
export DD_SITE=

datadog-ci deployment mark --env prod --revision 1.0.0
```

This set of commands specifies that the CI job performs a rollback deployment to the `prod` environment:

```shell
export DD_BETA_COMMANDS_ENABLED=1
export DD_API_KEY="<YOUR_API_KEY>"
export DD_SITE=

datadog-ci deployment mark --env prod --is-rollback
```

This set of commands specifies that the CI job executes a deployment to the `prod` environment and adds the `team:backend` and `reason:scheduled` tags to the deployment event:

```shell
export DD_BETA_COMMANDS_ENABLED=1
export DD_API_KEY="<YOUR_API_KEY>"
export DD_SITE=

datadog-ci deployment mark --env prod --tags team:backend --tags reason:scheduled
```

## Mark GitHub Actions jobs as deployments{% #mark-github-actions-jobs-as-deployments %}

Starting with `datadog-ci` version `4.1.1`, no additional action is required, even when using custom names or matrix strategies.

{% collapsible-section %}
**For datadog-ci versions prior to 4.1.1**
If you are using `datadog-ci` version `2.29.0` to `4.1.0` and the job name does not match the entry defined in the workflow configuration file (the GitHub [job ID](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id)), the `DD_GITHUB_JOB_NAME` environment variable needs to be exposed, pointing to the job name. For example:

1. If the job name is changed using the [name property](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#name):

   ```yaml
   jobs:
     deploy:
       name: My deployment job name
       env:
         DD_GITHUB_JOB_NAME: My deployment job name
       steps:
       - run: datadog-ci deployment mark ...
   ```

1. If the [matrix strategy](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#using-a-matrix-strategy) is used, several job names are generated by GitHub by adding the matrix values at the end of the job name, within parenthesis. The `DD_GITHUB_JOB_NAME` environment variable should then be conditional on the matrix values:

   ```yaml
   jobs:
     deployment:
       strategy:
         matrix:
           env: [dev, staging]
       env:
         DD_GITHUB_JOB_NAME: deployment (${{ matrix.env }})
       steps:
       - run: datadog-ci deployment mark ...
   ```

{% /collapsible-section %}

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

- [Learn about Deployment Visibility](https://docs.datadoghq.com/continuous_delivery/deployments.md)
- [Learn how to query and visualize deployments](https://docs.datadoghq.com/continuous_delivery/explorer.md)
