DORA Metrics

Send events for DORA Metrics to measure and improve software delivery.

Note: This endpoint is in private beta for CI Pipeline Visibility customers. If you want to request access, complete the form.

POST https://api.ap1.datadoghq.com/api/v2/dora/deploymenthttps://api.datadoghq.eu/api/v2/dora/deploymenthttps://api.ddog-gov.com/api/v2/dora/deploymenthttps://api.datadoghq.com/api/v2/dora/deploymenthttps://api.us3.datadoghq.com/api/v2/dora/deploymenthttps://api.us5.datadoghq.com/api/v2/dora/deployment

Overview

Use this API endpoint to provide data about deployments for DORA metrics.

This is necessary for:

  • Deployment Frequency
  • Change Lead Time
  • Change Failure Rate

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

The JSON:API data.

attributes [required]

object

Attributes to create a DORA deployment event.

finished_at [required]

int64

Unix timestamp in nanoseconds when the deployment finished. It should not be older than 3 hours.

git

object

Git info for DORA Metrics events.

commit_sha [required]

string

Git Commit SHA.

repository_url [required]

string

Git Repository URL

id

string

Deployment ID.

service [required]

string

Service name from a service available in the Service Catalog.

started_at [required]

int64

Unix timestamp in nanoseconds when the deployment started.

version

string

Version to correlate with APM Deployment Tracking.

{
  "data": {
    "attributes": {
      "finished_at": 1693491984000000000,
      "git": {
        "commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
        "repository_url": "https://github.com/organization/example-repository"
      },
      "service": "shopist",
      "started_at": 1693491974000000000,
      "version": "v1.12.07"
    }
  }
}

Response

OK

Response after receiving a DORA deployment event.

Expand All

Field

Type

Description

data [required]

object

The JSON:API data.

id [required]

string

The ID of the received DORA deployment event.

type

enum

JSON:API type for DORA deployment events. Allowed enum values: dora_deployment

default: dora_deployment

{
  "data": {
    "id": "4242fcdd31586083",
    "type": "dora_deployment"
  }
}

OK - but delayed due to incident

Response after receiving a DORA deployment event.

Expand All

Field

Type

Description

data [required]

object

The JSON:API data.

id [required]

string

The ID of the received DORA deployment event.

type

enum

JSON:API type for DORA deployment events. Allowed enum values: dora_deployment

default: dora_deployment

{
  "data": {
    "id": "4242fcdd31586083",
    "type": "dora_deployment"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not Authorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/dora/deployment" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -d @- << EOF { "data": { "attributes": { "finished_at": 1693491984000000000, "git": { "commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository" }, "service": "shopist", "started_at": 1693491974000000000, "version": "v1.12.07" } } } EOF
// Send a deployment event for DORA Metrics returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DoraMetricsApi;
import com.datadog.api.client.v2.model.DORADeploymentRequest;
import com.datadog.api.client.v2.model.DORADeploymentRequestAttributes;
import com.datadog.api.client.v2.model.DORADeploymentRequestData;
import com.datadog.api.client.v2.model.DORADeploymentResponse;
import com.datadog.api.client.v2.model.DORAGitInfo;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.createDORADeployment", true);
    DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient);

    DORADeploymentRequest body =
        new DORADeploymentRequest()
            .data(
                new DORADeploymentRequestData()
                    .attributes(
                        new DORADeploymentRequestAttributes()
                            .finishedAt(1693491984000000000L)
                            .git(
                                new DORAGitInfo()
                                    .commitSha("66adc9350f2cc9b250b69abddab733dd55e1a588")
                                    .repositoryUrl(
                                        "https://github.com/organization/example-repository"))
                            .service("shopist")
                            .startedAt(1693491974000000000L)
                            .version("v1.12.07")));

    try {
      DORADeploymentResponse result = apiInstance.createDORADeployment(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DoraMetricsApi#createDORADeployment");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" java "Example.java"

Note: This endpoint is in private beta for CI Pipeline Visibility customers. If you want to request access, complete the form.

POST https://api.ap1.datadoghq.com/api/v2/dora/incidenthttps://api.datadoghq.eu/api/v2/dora/incidenthttps://api.ddog-gov.com/api/v2/dora/incidenthttps://api.datadoghq.com/api/v2/dora/incidenthttps://api.us3.datadoghq.com/api/v2/dora/incidenthttps://api.us5.datadoghq.com/api/v2/dora/incident

Overview

Use this API endpoint to provide data about incidents for DORA metrics.

This is necessary for:

  • Change Failure Rate
  • Time to Restore

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

The JSON:API data.

attributes [required]

object

Attributes to create a DORA incident event.

finished_at

int64

Unix timestamp in nanoseconds when the deployment finished. It should not be older than 3 hours.

git

object

Git info for DORA Metrics events.

commit_sha [required]

string

Git Commit SHA.

repository_url [required]

string

Git Repository URL

id

string

Incident ID

name

string

Incident name.

service [required]

string

Service name from a service available in the Service Catalog.

severity

string

Incident severity.

started_at [required]

int64

Unix timestamp in nanoseconds when the deployment started.

version

string

Version to correlate with APM Deployment Tracking.

{
  "data": {
    "attributes": {
      "finished_at": 1693491984000000000,
      "git": {
        "commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
        "repository_url": "https://github.com/organization/example-repository"
      },
      "name": "Webserver is down failing all requests",
      "service": "shopist",
      "severity": "High",
      "started_at": 1693491974000000000,
      "version": "v1.12.07"
    }
  }
}

Response

OK

Response after receiving a DORA incident event.

Expand All

Field

Type

Description

data [required]

object

Response after receiving a DORA incident event.

id [required]

string

The ID of the received DORA incident event.

type

enum

JSON:API type for DORA incident events. Allowed enum values: dora_incident

default: dora_incident

{
  "data": {
    "id": "4242fcdd31586083",
    "type": "dora_incident"
  }
}

OK - but delayed due to incident

Response after receiving a DORA incident event.

Expand All

Field

Type

Description

data [required]

object

Response after receiving a DORA incident event.

id [required]

string

The ID of the received DORA incident event.

type

enum

JSON:API type for DORA incident events. Allowed enum values: dora_incident

default: dora_incident

{
  "data": {
    "id": "4242fcdd31586083",
    "type": "dora_incident"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not Authorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/dora/incident" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -d @- << EOF { "data": { "attributes": { "finished_at": 1693491984000000000, "git": { "commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository" }, "name": "Webserver is down failing all requests", "service": "shopist", "severity": "High", "started_at": 1693491974000000000, "version": "v1.12.07" } } } EOF
// Send an incident event for DORA Metrics returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DoraMetricsApi;
import com.datadog.api.client.v2.model.DORAGitInfo;
import com.datadog.api.client.v2.model.DORAIncidentRequest;
import com.datadog.api.client.v2.model.DORAIncidentRequestAttributes;
import com.datadog.api.client.v2.model.DORAIncidentRequestData;
import com.datadog.api.client.v2.model.DORAIncidentResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.createDORAIncident", true);
    DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient);

    DORAIncidentRequest body =
        new DORAIncidentRequest()
            .data(
                new DORAIncidentRequestData()
                    .attributes(
                        new DORAIncidentRequestAttributes()
                            .finishedAt(1693491984000000000L)
                            .git(
                                new DORAGitInfo()
                                    .commitSha("66adc9350f2cc9b250b69abddab733dd55e1a588")
                                    .repositoryUrl(
                                        "https://github.com/organization/example-repository"))
                            .name("Webserver is down failing all requests")
                            .service("shopist")
                            .severity("High")
                            .startedAt(1693491974000000000L)
                            .version("v1.12.07")));

    try {
      DORAIncidentResponse result = apiInstance.createDORAIncident(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DoraMetricsApi#createDORAIncident");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" java "Example.java"