인시던트 이벤트 보내기(레거시)
https://api.datadoghq.com/api/v2/dora/incidenthttps://api.us3.datadoghq.com/api/v2/dora/incidenthttps://api.us5.datadoghq.com/api/v2/dora/incidenthttps://api.datadoghq.eu/api/v2/dora/incidenthttps://api.ap1.datadoghq.com/api/v2/dora/incidenthttps://api.ap2.datadoghq.com/api/v2/dora/incidenthttps://api.uk1.datadoghq.com/api/v2/dora/incidenthttps://api.ddog-gov.com/api/v2/dora/incidenthttps://api.us2.ddog-gov.com/api/v2/dora/incident개요
참고: 이 엔드포인트는 지원이 중단되었습니다. 대신 /api/v2/dora/failure를 사용하세요.
이 API 엔드포인트를 사용하여 인시던트 데이터를 제공할 수 있습니다. 인시던트를 추적하면 실패한 배포가 실제 인시던트로 변환되는 방식을 나란히 비교하여 볼 수 있습니다.
요청
Body Data (required)
data [required]DORA 인시던트 이벤트를 생성하도록 요청합니다.
attributes [required]Attributes to create a DORA incident event.
custom_tagsA list of user-defined tags. The tags must follow the key:value pattern. Up to 100 may be added per event.
envEnvironment name that was impacted by the incident.
finished_atUnix timestamp when the incident finished. It must be in nanoseconds, milliseconds, or seconds.
gitGit info for DORA Metrics events.
commit_sha [required]Git Commit SHA.
repository_url [required]Git Repository URL
idIncident ID. Must be 16-128 characters and contain only alphanumeric characters, hyphens, underscores, periods, and colons (a-z, A-Z, 0-9, -, _, ., :).
nameIncident name.
servicesService names impacted by the incident. If possible, use names registered in the Service Catalog. Required when the team field is not provided.
severityIncident severity.
started_at [required]Unix timestamp when the incident started. It must be in nanoseconds, milliseconds, or seconds.
teamName of the team owning the services impacted. If possible, use team handles registered in Datadog. Required when the services field is not provided.
{
"data": {
"attributes": {
"finished_at": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}응답
OK
Response after receiving a DORA incident event.
data [required]Response after receiving a DORA incident event.
id [required]The ID of the received DORA incident event.
typeJSON:API type for DORA incident events.
dora_failuredora_failure{
"data": {
"id": "4242fcdd31586083",
"type": "dora_failure"
}
}OK - but delayed due to incident
Response after receiving a DORA incident event.
data [required]Response after receiving a DORA incident event.
id [required]The ID of the received DORA incident event.
typeJSON:API type for DORA incident events.
dora_failuredora_failure{
"data": {
"id": "4242fcdd31586083",
"type": "dora_failure"
}
}Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Not Authorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}코드 예시
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://api.${DD_SITE}/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": 1707842944600000000,
"git": {
"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588",
"repository_url": "https://github.com/organization/example-repository"
},
"name": "Webserver is down failing all requests",
"services": [
"shopist"
],
"severity": "High",
"started_at": 1707842944500000000,
"team": "backend",
"version": "v1.12.07"
}
}
}
EOF