이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

DORA Metrics is not available in the selected site () at this time.

DORA Metrics is in public beta.

Overview

To send your own deployment events, use the DORA Metrics API or the datadog-ci dora deployment command.

The following attributes are required:

  • started_at: The time the deployment started.
  • finished_at: The time the deployment finished.
  • service: The service that was deployed. If the provided service is registered in the Service Catalog with metadata set up (see Adding Metadata), the team of the service is automatically retrieved and associated with all metrics.

The repository_url and commit_sha attributes are also required for calculating the Change Lead Time metric. Optionally, you can specifiy a team attribute to associate a deployment with a different team than is found automatically for the service. You can also optionally specify the env attribute to filter your DORA metrics by environment on the DORA Metrics page.

Example

See the DORA Metrics API reference documentation for the full spec and additional code samples.

For the following example, replace <DD_SITE> in the URL with and ${DD_API_KEY} with your Datadog API Key:

  curl -X POST "https://api.<DD_SITE>/api/v2/dora/deployment" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "DD-API-KEY: ${DD_API_KEY}" \
  -d @- << EOF
  {
    "data": {
      "attributes": {
        "service": "shopist",
        "started_at": 1693491974000000000,
        "finished_at": 1693491984000000000,
        "git": {
          "commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
          "repository_url": "https://github.com/organization/example-repository"
        },
        "env": "prod",
        "team": "backend"
      }
    }
  }
EOF

The datadog-ci CLI tool provides a shortcut to send deployment events within your Continuous Integration environment.

For the following example, set the DD_SITE environment variable to and set the DD_API_KEY environment variable to your Datadog API Key:

export DD_BETA_COMMANDS_ENABLED=1
export DD_SITE="<DD_SITE>"
export DD_API_KEY="<DD_API_KEY>"

export deploy_start=`date +%s`
./your-deploy-script.sh
datadog-ci dora deployment --service shopist --env prod \
    --started-at $deploy_start --finished-at `date +%s` \
    --git-repository-url "https://github.com/organization/example-repository" \
    --git-commit-sha 66adc9350f2cc9b250b69abddab733dd55e1a588

The deployment finish time is automatically set to now if --finished-at is not provided.

If the deployment CI job is running on the exact same Git revision that is being deployed, git-repository-url and git-commit-sha can be omitted and are automatically inferred from the CI context.

The --skip-git option can be provided to disable sending the repository URL and commit SHA. When this option is added, the Change Lead Time metric becomes unavailable.

Further Reading

PREVIEWING: may/unit-testing