Skip to content

Update DORA endpoints #2279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-04 17:40:37.542641",
"spec_repo_commit": "38b3c05a"
"regenerated": "2025-06-05 08:11:19.271303",
"spec_repo_commit": "0e7259ca"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-04 17:40:37.559899",
"spec_repo_commit": "38b3c05a"
"regenerated": "2025-06-05 08:11:19.287369",
"spec_repo_commit": "0e7259ca"
}
}
}
155 changes: 100 additions & 55 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11189,56 +11189,39 @@ components:
description: The type of the event.
type: string
type: object
DORAFetchResponse:
description: Response for the DORA fetch endpoints.
properties:
data:
$ref: '#/components/schemas/DORAEvent'
type: object
DORAGitInfo:
description: Git info for DORA Metrics events.
properties:
commit_sha:
$ref: '#/components/schemas/GitCommitSHA'
repository_url:
$ref: '#/components/schemas/GitRepositoryURL'
required:
- repository_url
- commit_sha
type: object
DORAIncidentRequest:
description: Request to create a DORA incident event.
DORAFailureRequest:
description: Request to create a DORA failure event.
properties:
data:
$ref: '#/components/schemas/DORAIncidentRequestData'
$ref: '#/components/schemas/DORAFailureRequestData'
required:
- data
type: object
DORAIncidentRequestAttributes:
description: Attributes to create a DORA incident event.
DORAFailureRequestAttributes:
description: Attributes to create a DORA failure event.
properties:
env:
description: Environment name that was impacted by the incident.
description: Environment name that was impacted by the failure.
example: staging
type: string
finished_at:
description: Unix timestamp when the incident finished. It must be in nanoseconds,
description: Unix timestamp when the failure finished. It must be in nanoseconds,
milliseconds, or seconds, and it should not be older than 1 hour.
example: 1693491984000000000
format: int64
type: integer
git:
$ref: '#/components/schemas/DORAGitInfo'
id:
description: Incident ID. Must have at least 16 characters. Required to
update a previously sent incident.
description: Failure ID. Must have at least 16 characters. Required to update
a previously sent failure.
type: string
name:
description: Incident name.
description: Failure name.
example: Webserver is down failing all requests.
type: string
services:
description: Service names impacted by the incident. If possible, use names
description: Service names impacted by the failure. If possible, use names
registered in the Service Catalog. Required when the team field is not
provided.
example:
Expand All @@ -11247,11 +11230,11 @@ components:
type: string
type: array
severity:
description: Incident severity.
description: Failure severity.
example: High
type: string
started_at:
description: Unix timestamp when the incident started. It must be in nanoseconds,
description: Unix timestamp when the failure started. It must be in nanoseconds,
milliseconds, or seconds.
example: 1693491974000000000
format: int64
Expand All @@ -11269,43 +11252,60 @@ components:
required:
- started_at
type: object
DORAIncidentRequestData:
DORAFailureRequestData:
description: The JSON:API data.
properties:
attributes:
$ref: '#/components/schemas/DORAIncidentRequestAttributes'
$ref: '#/components/schemas/DORAFailureRequestAttributes'
required:
- attributes
type: object
DORAIncidentResponse:
description: Response after receiving a DORA incident event.
DORAFailureResponse:
description: Response after receiving a DORA failure event.
properties:
data:
$ref: '#/components/schemas/DORAIncidentResponseData'
$ref: '#/components/schemas/DORAFailureResponseData'
required:
- data
type: object
DORAIncidentResponseData:
description: Response after receiving a DORA incident event.
DORAFailureResponseData:
description: Response after receiving a DORA failure event.
properties:
id:
description: The ID of the received DORA incident event.
description: The ID of the received DORA failure event.
example: 4242fcdd31586083
type: string
type:
$ref: '#/components/schemas/DORAIncidentType'
$ref: '#/components/schemas/DORAFailureType'
required:
- id
type: object
DORAIncidentType:
default: dora_incident
description: JSON:API type for DORA incident events.
DORAFailureType:
default: dora_failure
description: JSON:API type for DORA failure events.
enum:
- dora_incident
example: dora_incident
- dora_failure
example: dora_failure
type: string
x-enum-varnames:
- DORA_INCIDENT
- DORA_FAILURE
DORAFetchResponse:
description: Response for the DORA fetch endpoints.
properties:
data:
$ref: '#/components/schemas/DORAEvent'
type: object
DORAGitInfo:
description: Git info for DORA Metrics events.
properties:
commit_sha:
$ref: '#/components/schemas/GitCommitSHA'
repository_url:
$ref: '#/components/schemas/GitRepositoryURL'
required:
- repository_url
- commit_sha
type: object
DORAListDeploymentsRequest:
description: Request to get a list of deployments.
properties:
Expand Down Expand Up @@ -46094,9 +46094,6 @@ paths:
tags:
- DORA Metrics
x-codegen-request-body-name: body
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/dora/deployments:
post:
description: Use this API endpoint to get a list of deployment events.
Expand Down Expand Up @@ -46174,6 +46171,52 @@ paths:
operator: OR
permissions:
- dora_metrics_read
/api/v2/dora/failure:
post:
description: 'Use this API endpoint to provide failure data for DORA metrics.


This is necessary for:

- Change Failure Rate

- Time to Restore'
operationId: CreateDORAFailure
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DORAFailureRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DORAFailureResponse'
description: OK
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/DORAFailureResponse'
description: OK - but delayed due to incident
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
summary: Send a failure event for DORA Metrics
tags:
- DORA Metrics
x-codegen-request-body-name: body
/api/v2/dora/failures:
post:
description: Use this API endpoint to get a list of failure events.
Expand Down Expand Up @@ -46253,7 +46296,12 @@ paths:
- dora_metrics_read
/api/v2/dora/incident:
post:
description: 'Use this API endpoint to provide failure data for DORA metrics.
deprecated: true
description: '**Note**: This endpoint is deprecated. Please use `/api/v2/dora/failure`
instead.


Use this API endpoint to provide failure data for DORA metrics.


This is necessary for:
Expand All @@ -46266,20 +46314,20 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/DORAIncidentRequest'
$ref: '#/components/schemas/DORAFailureRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DORAIncidentResponse'
$ref: '#/components/schemas/DORAFailureResponse'
description: OK
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/DORAIncidentResponse'
$ref: '#/components/schemas/DORAFailureResponse'
description: OK - but delayed due to incident
'400':
content:
Expand All @@ -46297,9 +46345,6 @@ paths:
tags:
- DORA Metrics
x-codegen-request-body-name: body
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/downtime:
get:
description: Get all scheduled downtimes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"log": {
"_recordingName": "DORA Metrics/Send an incident event for DORA Metrics returns \"OK\" response",
"_recordingName": "DORA Metrics/Send a failure event for DORA Metrics returns \"OK\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
Expand Down Expand Up @@ -42,7 +42,7 @@
"content": {
"mimeType": "application/vnd.api+json",
"size": 77,
"text": "{\"data\":{\"id\":\"2775a2d3-6c28-4934-ae60-0ef9ce3720ee\",\"type\":\"dora_incident\"}}"
"text": "{\"data\":{\"id\":\"2775a2d3-6c28-4934-ae60-0ef9ce3720ee\",\"type\":\"dora_failure\"}}"
},
"cookies": [],
"headers": [
Expand Down
1 change: 0 additions & 1 deletion examples/v2/dora-metrics/CreateDORADeployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createDORADeployment"] = true;
const apiInstance = new v2.DORAMetricsApi(configuration);

const params: v2.DORAMetricsApiCreateDORADeploymentRequest = {
Expand Down
38 changes: 38 additions & 0 deletions examples/v2/dora-metrics/CreateDORAFailure.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Send a failure event for DORA Metrics returns "OK - but delayed due to incident" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.DORAMetricsApi(configuration);

const params: v2.DORAMetricsApiCreateDORAFailureRequest = {
body: {
data: {
attributes: {
env: "staging",
finishedAt: 1693491984000000000,
git: {
commitSha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
repositoryUrl: "https://github.com/organization/example-repository",
},
name: "Webserver is down failing all requests.",
services: ["shopist"],
severity: "High",
startedAt: 1693491974000000000,
team: "backend",
version: "v1.12.07",
},
},
},
};

apiInstance
.createDORAFailure(params)
.then((data: v2.DORAFailureResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
10 changes: 5 additions & 5 deletions examples/v2/dora-metrics/CreateDORAIncident.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createDORAIncident"] = true;
const apiInstance = new v2.DORAMetricsApi(configuration);

const params: v2.DORAMetricsApiCreateDORAIncidentRequest = {
body: {
data: {
attributes: {
finishedAt: 1707842944600000000,
env: "staging",
finishedAt: 1693491984000000000,
git: {
commitSha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
repositoryUrl: "https://github.com/organization/example-repository",
},
name: "Webserver is down failing all requests",
name: "Webserver is down failing all requests.",
services: ["shopist"],
severity: "High",
startedAt: 1707842944500000000,
startedAt: 1693491974000000000,
team: "backend",
version: "v1.12.07",
},
Expand All @@ -30,7 +30,7 @@ const params: v2.DORAMetricsApiCreateDORAIncidentRequest = {

apiInstance
.createDORAIncident(params)
.then((data: v2.DORAIncidentResponse) => {
.then((data: v2.DORAFailureResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
Expand Down
Loading