Skip to content

Commit 7b67a59

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
SDCD-1142: adding custom_tags optional attribute to DORA API spec (#697)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 231ce99 commit 7b67a59

File tree

8 files changed

+73
-9
lines changed

8 files changed

+73
-9
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-06-13 19:38:13.640241",
8-
"spec_repo_commit": "6eb36f2b"
7+
"regenerated": "2025-06-16 08:24:49.323712",
8+
"spec_repo_commit": "b2c4e7e8"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-13 19:38:13.656009",
13-
"spec_repo_commit": "6eb36f2b"
12+
"regenerated": "2025-06-16 08:24:49.341406",
13+
"spec_repo_commit": "b2c4e7e8"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11095,6 +11095,17 @@ components:
1109511095
- version
1109611096
- name
1109711097
type: object
11098+
DORACustomTags:
11099+
description: A list of user-defined tags. The tags must follow the `key:value`
11100+
pattern. Up to 100 may be added per event.
11101+
example:
11102+
- language:java
11103+
- department:engineering
11104+
items:
11105+
description: Tags in the form of `key:value`.
11106+
type: string
11107+
nullable: true
11108+
type: array
1109811109
DORADeploymentRequest:
1109911110
description: Request to create a DORA deployment event.
1110011111
properties:
@@ -11106,6 +11117,8 @@ components:
1110611117
DORADeploymentRequestAttributes:
1110711118
description: Attributes to create a DORA deployment event.
1110811119
properties:
11120+
custom_tags:
11121+
$ref: '#/components/schemas/DORACustomTags'
1110911122
env:
1111011123
description: Environment name to where the service was deployed.
1111111124
example: staging
@@ -11208,6 +11221,8 @@ components:
1120811221
DORAFailureRequestAttributes:
1120911222
description: Attributes to create a DORA failure event.
1121011223
properties:
11224+
custom_tags:
11225+
$ref: '#/components/schemas/DORACustomTags'
1121111226
env:
1121211227
description: Environment name that was impacted by the failure.
1121311228
example: staging

LICENSE-3rdparty.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ crc32fast,https://github.com/srijs/rust-crc32fast,MIT OR Apache-2.0,"Sam Rijs <s
1919
darling,https://github.com/TedDriggs/darling,MIT,Ted Driggs <[email protected]>
2020
deranged,https://github.com/jhpratt/deranged,MIT OR Apache-2.0,Jacob Pratt <[email protected]>
2121
displaydoc,https://github.com/yaahc/displaydoc,MIT OR Apache-2.0,Jane Lusby <[email protected]>
22+
dyn-clone,https://github.com/dtolnay/dyn-clone,MIT OR Apache-2.0,David Tolnay <[email protected]>
2223
encoding_rs,https://github.com/hsivonen/encoding_rs,(Apache-2.0 OR MIT) AND BSD-3-Clause,Henri Sivonen <[email protected]>
2324
equivalent,https://github.com/indexmap-rs/equivalent,Apache-2.0 OR MIT,The equivalent Authors
2425
errno,https://github.com/lambda-fairy/rust-errno,MIT OR Apache-2.0,"Chris Wong <[email protected]>, Dan Gohman <[email protected]>"
@@ -96,6 +97,7 @@ r-efi,https://github.com/r-efi/r-efi,MIT OR Apache-2.0 OR LGPL-2.1-or-later,The
9697
rand,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
9798
rand_chacha,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers, The CryptoCorrosion Contributors"
9899
redox_syscall,https://gitlab.redox-os.org/redox-os/syscall,MIT,Jeremy Soller <[email protected]>
100+
ref-cast,https://github.com/dtolnay/ref-cast,MIT OR Apache-2.0,David Tolnay <[email protected]>
99101
reqwest,https://github.com/seanmonstar/reqwest,MIT OR Apache-2.0,Sean McArthur <[email protected]>
100102
reqwest-middleware,https://github.com/TrueLayer/reqwest-middleware,MIT OR Apache-2.0,Rodrigo Gryzinski <[email protected]>
101103
retry-policies,https://github.com/TrueLayer/retry-policies,MIT OR Apache-2.0,Luca Palmieri <[email protected]>
@@ -105,6 +107,7 @@ rustls-pemfile,https://github.com/rustls/pemfile,Apache-2.0 OR ISC OR MIT,The ru
105107
rustversion,https://github.com/dtolnay/rustversion,MIT OR Apache-2.0,David Tolnay <[email protected]>
106108
ryu,https://github.com/dtolnay/ryu,Apache-2.0 OR BSL-1.0,David Tolnay <[email protected]>
107109
schannel,https://github.com/steffengy/schannel-rs,MIT,"Steven Fackler <[email protected]>, Steffen Butzer <[email protected]>"
110+
schemars,https://github.com/GREsau/schemars,MIT,Graham Esau <[email protected]>
108111
scopeguard,https://github.com/bluss/scopeguard,MIT OR Apache-2.0,bluss
109112
security-framework,https://github.com/kornelski/rust-security-framework,MIT OR Apache-2.0,"Steven Fackler <[email protected]>, Kornel <[email protected]>"
110113
serde,https://github.com/serde-rs/serde,MIT OR Apache-2.0,"Erick Tryzelaar <[email protected]>, David Tolnay <[email protected]>"

examples/v2_dora-metrics_CreateDORAFailure.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ use datadog_api_client::datadogV2::model::DORAGitInfo;
1111
async fn main() {
1212
let body = DORAFailureRequest::new(DORAFailureRequestData::new(
1313
DORAFailureRequestAttributes::new(1693491974000000000)
14+
.custom_tags(Some(vec![
15+
"language:java".to_string(),
16+
"department:engineering".to_string(),
17+
]))
1418
.env("staging".to_string())
1519
.finished_at(1693491984000000000)
1620
.git(DORAGitInfo::new(

examples/v2_dora-metrics_CreateDORAIncident.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ use datadog_api_client::datadogV2::model::DORAGitInfo;
1010
async fn main() {
1111
let body = DORAFailureRequest::new(DORAFailureRequestData::new(
1212
DORAFailureRequestAttributes::new(1693491974000000000)
13+
.custom_tags(Some(vec![
14+
"language:java".to_string(),
15+
"department:engineering".to_string(),
16+
]))
1317
.env("staging".to_string())
1418
.finished_at(1693491984000000000)
1519
.git(DORAGitInfo::new(

src/datadogV2/model/model_dora_deployment_request_attributes.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct DORADeploymentRequestAttributes {
14+
/// A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event.
15+
#[serde(
16+
rename = "custom_tags",
17+
default,
18+
with = "::serde_with::rust::double_option"
19+
)]
20+
pub custom_tags: Option<Option<Vec<String>>>,
1421
/// Environment name to where the service was deployed.
1522
#[serde(rename = "env")]
1623
pub env: Option<String>,
@@ -49,6 +56,7 @@ impl DORADeploymentRequestAttributes {
4956
started_at: i64,
5057
) -> DORADeploymentRequestAttributes {
5158
DORADeploymentRequestAttributes {
59+
custom_tags: None,
5260
env: None,
5361
finished_at,
5462
git: None,
@@ -62,6 +70,11 @@ impl DORADeploymentRequestAttributes {
6270
}
6371
}
6472

73+
pub fn custom_tags(mut self, value: Option<Vec<String>>) -> Self {
74+
self.custom_tags = Some(value);
75+
self
76+
}
77+
6578
pub fn env(mut self, value: String) -> Self {
6679
self.env = Some(value);
6780
self
@@ -113,6 +126,7 @@ impl<'de> Deserialize<'de> for DORADeploymentRequestAttributes {
113126
where
114127
M: MapAccess<'a>,
115128
{
129+
let mut custom_tags: Option<Option<Vec<String>>> = None;
116130
let mut env: Option<String> = None;
117131
let mut finished_at: Option<i64> = None;
118132
let mut git: Option<crate::datadogV2::model::DORAGitInfo> = None;
@@ -129,6 +143,10 @@ impl<'de> Deserialize<'de> for DORADeploymentRequestAttributes {
129143

130144
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
131145
match k.as_str() {
146+
"custom_tags" => {
147+
custom_tags =
148+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
149+
}
132150
"env" => {
133151
if v.is_null() {
134152
continue;
@@ -182,6 +200,7 @@ impl<'de> Deserialize<'de> for DORADeploymentRequestAttributes {
182200
let started_at = started_at.ok_or_else(|| M::Error::missing_field("started_at"))?;
183201

184202
let content = DORADeploymentRequestAttributes {
203+
custom_tags,
185204
env,
186205
finished_at,
187206
git,

src/datadogV2/model/model_dora_failure_request_attributes.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct DORAFailureRequestAttributes {
14+
/// A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event.
15+
#[serde(
16+
rename = "custom_tags",
17+
default,
18+
with = "::serde_with::rust::double_option"
19+
)]
20+
pub custom_tags: Option<Option<Vec<String>>>,
1421
/// Environment name that was impacted by the failure.
1522
#[serde(rename = "env")]
1623
pub env: Option<String>,
@@ -51,6 +58,7 @@ pub struct DORAFailureRequestAttributes {
5158
impl DORAFailureRequestAttributes {
5259
pub fn new(started_at: i64) -> DORAFailureRequestAttributes {
5360
DORAFailureRequestAttributes {
61+
custom_tags: None,
5462
env: None,
5563
finished_at: None,
5664
git: None,
@@ -66,6 +74,11 @@ impl DORAFailureRequestAttributes {
6674
}
6775
}
6876

77+
pub fn custom_tags(mut self, value: Option<Vec<String>>) -> Self {
78+
self.custom_tags = Some(value);
79+
self
80+
}
81+
6982
pub fn env(mut self, value: String) -> Self {
7083
self.env = Some(value);
7184
self
@@ -137,6 +150,7 @@ impl<'de> Deserialize<'de> for DORAFailureRequestAttributes {
137150
where
138151
M: MapAccess<'a>,
139152
{
153+
let mut custom_tags: Option<Option<Vec<String>>> = None;
140154
let mut env: Option<String> = None;
141155
let mut finished_at: Option<i64> = None;
142156
let mut git: Option<crate::datadogV2::model::DORAGitInfo> = None;
@@ -155,6 +169,10 @@ impl<'de> Deserialize<'de> for DORAFailureRequestAttributes {
155169

156170
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
157171
match k.as_str() {
172+
"custom_tags" => {
173+
custom_tags =
174+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
175+
}
158176
"env" => {
159177
if v.is_null() {
160178
continue;
@@ -223,6 +241,7 @@ impl<'de> Deserialize<'de> for DORAFailureRequestAttributes {
223241
let started_at = started_at.ok_or_else(|| M::Error::missing_field("started_at"))?;
224242

225243
let content = DORAFailureRequestAttributes {
244+
custom_tags,
226245
env,
227246
finished_at,
228247
git,

tests/scenarios/features/v2/dora_metrics.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Feature: DORA Metrics
7979
@generated @skip @team:DataDog/ci-app-backend
8080
Scenario: Send a deployment event for DORA Metrics returns "OK - but delayed due to incident" response
8181
Given new "CreateDORADeployment" request
82-
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
82+
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
8383
When the request is sent
8484
Then the response status is 202 OK - but delayed due to incident
8585

@@ -100,7 +100,7 @@ Feature: DORA Metrics
100100
@generated @skip @team:DataDog/ci-app-backend
101101
Scenario: Send a failure event for DORA Metrics returns "OK - but delayed due to incident" response
102102
Given new "CreateDORAFailure" request
103-
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "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": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
103+
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "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": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
104104
When the request is sent
105105
Then the response status is 202 OK - but delayed due to incident
106106

@@ -114,20 +114,20 @@ Feature: DORA Metrics
114114
@generated @skip @team:DataDog/ci-app-backend
115115
Scenario: Send an incident event for DORA Metrics returns "Bad Request" response
116116
Given new "CreateDORAIncident" request
117-
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "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": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
117+
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "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": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
118118
When the request is sent
119119
Then the response status is 400 Bad Request
120120

121121
@generated @skip @team:DataDog/ci-app-backend
122122
Scenario: Send an incident event for DORA Metrics returns "OK - but delayed due to incident" response
123123
Given new "CreateDORAIncident" request
124-
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "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": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
124+
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "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": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
125125
When the request is sent
126126
Then the response status is 202 OK - but delayed due to incident
127127

128128
@generated @skip @team:DataDog/ci-app-backend
129129
Scenario: Send an incident event for DORA Metrics returns "OK" response
130130
Given new "CreateDORAIncident" request
131-
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "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": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
131+
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "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": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
132132
When the request is sent
133133
Then the response status is 200 OK

0 commit comments

Comments
 (0)