Deployments 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:
Your CI provider supports the Custom tags and measures at runtime feature, which allows you to add user-defined text and numerical tags to pipelines and jobs in Pipeline Visibility.
You are executing deployments in a CI job (or a related level 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.
This set of commands specifies that the CI job executes a deployment to the prod environment with version 1.0.0:
exportDD_BETA_COMMANDS_ENABLED=1exportDD_API_KEY="<YOUR_API_KEY>"exportDD_SITE=datadoghq.comdatadog-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:
exportDD_BETA_COMMANDS_ENABLED=1exportDD_API_KEY="<YOUR_API_KEY>"exportDD_SITE=datadoghq.comdatadog-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:
exportDD_BETA_COMMANDS_ENABLED=1exportDD_API_KEY="<YOUR_API_KEY>"exportDD_SITE=datadoghq.comdatadog-ci deployment mark --env prod --tags team:backend --tags reason:scheduled
To mark GitHub jobs as deployments, datadog-ci CLI version 2.29.0 or higher is required.
If the job name does not match the entry defined in the workflow configuration file (the GitHub job ID),
the DD_GITHUB_JOB_NAME environment variable needs to be exposed, pointing to the job name. For example:
If the 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:
jobs:deployment:strategy:matrix:env:[dev, staging]env:DD_GITHUB_JOB_NAME:deployment (${{ matrix.env }})steps:- run:datadog-ci deployment mark ...