Skip to content

Commit b6bf011

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ffbd7eb of spec repo
1 parent 9727dd3 commit b6bf011

21 files changed

+619
-452
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11900,6 +11900,60 @@ components:
1190011900
example: UTC
1190111901
type: string
1190211902
type: object
11903+
SLOCountDefinition:
11904+
description: 'A count-based (metric) SLI specification, composed of three parts:
11905+
the good events formula, the total events formula,
11906+
11907+
and the underlying queries.'
11908+
example:
11909+
good_events_formula: query1 - query2
11910+
queries:
11911+
- data_source: metrics
11912+
name: query1
11913+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11914+
- data_source: metrics
11915+
name: query2
11916+
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
11917+
total_events_formula: query1
11918+
properties:
11919+
good_events_formula:
11920+
$ref: '#/components/schemas/SLOFormula'
11921+
queries:
11922+
example:
11923+
- data_source: metrics
11924+
name: query1
11925+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11926+
items:
11927+
$ref: '#/components/schemas/SLODataSourceQueryDefinition'
11928+
minItems: 1
11929+
type: array
11930+
total_events_formula:
11931+
$ref: '#/components/schemas/SLOFormula'
11932+
required:
11933+
- good_events_formula
11934+
- total_events_formula
11935+
- queries
11936+
type: object
11937+
SLOCountSpec:
11938+
additionalProperties: false
11939+
description: A metric SLI specification.
11940+
example:
11941+
count:
11942+
good_events_formula: query1 - query2
11943+
queries:
11944+
- data_source: metrics
11945+
name: query1
11946+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11947+
- data_source: metrics
11948+
name: query2
11949+
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
11950+
total_events_formula: query1
11951+
properties:
11952+
count:
11953+
$ref: '#/components/schemas/SLOCountDefinition'
11954+
required:
11955+
- count
11956+
type: object
1190311957
SLOCreator:
1190411958
description: The creator of the SLO
1190511959
nullable: true
@@ -12747,8 +12801,11 @@ components:
1274712801
type: string
1274812802
query:
1274912803
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
12804+
description: The metric query of good / total events.
1275012805
sli_specification:
1275112806
$ref: '#/components/schemas/SLOSliSpec'
12807+
description: A generic SLI specification. This is currently used for time-slice
12808+
and count-based (metric) SLOs only.
1275212809
tags:
1275312810
description: 'A list of tags associated with this service level objective.
1275412811

@@ -12804,10 +12861,11 @@ components:
1280412861
type: number
1280512862
type: object
1280612863
SLOSliSpec:
12807-
description: A generic SLI specification. This is currently used for time-slice
12808-
SLOs only.
12864+
description: A generic SLI specification. This is used for time-slice and count-based
12865+
(metric) SLOs only.
1280912866
oneOf:
1281012867
- $ref: '#/components/schemas/SLOTimeSliceSpec'
12868+
- $ref: '#/components/schemas/SLOCountSpec'
1281112869
SLOState:
1281212870
description: State of the SLO.
1281312871
enum:
@@ -13959,7 +14017,8 @@ components:
1395914017
- type
1396014018
type: object
1396114019
ServiceLevelObjectiveQuery:
13962-
description: 'A metric-based SLO. **Required if type is `metric`**. Note that
14020+
description: 'A count-based (metric) SLO query. This field is superseded by
14021+
`sli_specification` but is retained for backwards compatibility. Note that
1396314022
Datadog only allows the sum by aggregator
1396414023

1396514024
to be used because this will sum up all request counts instead of averaging

.generator/schemas/v2/openapi.yaml

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -24023,22 +24023,6 @@ components:
2402324023
type: string
2402424024
flaky_state:
2402524025
$ref: '#/components/schemas/FlakyTestAttributesFlakyState'
24026-
history:
24027-
description: 'Chronological history of status changes for this flaky test,
24028-
ordered from most recent to oldest.
24029-
24030-
Includes state transitions like new -> quarantined -> fixed, along with
24031-
the associated commit SHA when available.'
24032-
example:
24033-
- commit_sha: abc123def456
24034-
status: quarantined
24035-
timestamp: 1704067200000
24036-
- commit_sha: ''
24037-
status: new
24038-
timestamp: 1703980800000
24039-
items:
24040-
$ref: '#/components/schemas/FlakyTestHistory'
24041-
type: array
2404224026
last_flaked_branch:
2404324027
description: The branch name where the test exhibited flakiness for the
2404424028
last time.
@@ -24123,29 +24107,6 @@ components:
2412324107
- FIXED
2412424108
- QUARANTINED
2412524109
- DISABLED
24126-
FlakyTestHistory:
24127-
description: A single history entry representing a status change for a flaky
24128-
test.
24129-
properties:
24130-
commit_sha:
24131-
description: The commit SHA associated with this status change. Will be
24132-
an empty string if the commit SHA is not available.
24133-
example: abc123def456
24134-
type: string
24135-
status:
24136-
description: The test status at this point in history.
24137-
example: quarantined
24138-
type: string
24139-
timestamp:
24140-
description: Unix timestamp in milliseconds when this status change occurred.
24141-
example: 1704067200000
24142-
format: int64
24143-
type: integer
24144-
required:
24145-
- status
24146-
- commit_sha
24147-
- timestamp
24148-
type: object
2414924110
FlakyTestPipelineStats:
2415024111
description: CI pipeline related statistics for the flaky test. This information
2415124112
is only available if test runs are associated with CI pipeline events from
@@ -24292,17 +24253,6 @@ components:
2429224253
properties:
2429324254
filter:
2429424255
$ref: '#/components/schemas/FlakyTestsSearchFilter'
24295-
include_history:
24296-
default: false
24297-
description: 'Whether to include the status change history for each flaky
24298-
test in the response.
24299-
24300-
When set to true, each test will include a `history` array with chronological
24301-
status changes.
24302-
24303-
Defaults to false.'
24304-
example: true
24305-
type: boolean
2430624256
page:
2430724257
$ref: '#/components/schemas/FlakyTestsSearchPageOptions'
2430824258
sort:
@@ -101135,33 +101085,8 @@ paths:
101135101085

101136101086
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
101137101087
post:
101138-
description: 'List endpoint returning flaky tests from Flaky Test Management.
101088+
description: List endpoint returning flaky tests from Flaky Test Management.
101139101089
Results are paginated.
101140-
101141-
101142-
The response includes comprehensive test information including:
101143-
101144-
- Test identification and metadata (module, suite, name)
101145-
101146-
- Flaky state and categorization
101147-
101148-
- First and last flake occurrences (timestamp, branch, commit SHA)
101149-
101150-
- Test execution statistics from the last 7 days (failure rate)
101151-
101152-
- Pipeline impact metrics (failed pipelines count, total lost time)
101153-
101154-
- Complete status change history (optional, ordered from most recent to oldest)
101155-
101156-
101157-
Set `include_history` to `true` in the request to receive the status change
101158-
history for each test.
101159-
101160-
History is disabled by default for better performance.
101161-
101162-
101163-
Results support filtering by various facets including service, environment,
101164-
repository, branch, and test state.'
101165101090
operationId: SearchFlakyTests
101166101091
requestBody:
101167101092
content:
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Create a new metric SLO object using sli_specification returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v1.api.ServiceLevelObjectivesApi;
6+
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricDataSource;
7+
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricQueryDefinition;
8+
import com.datadog.api.client.v1.model.SLOCountDefinition;
9+
import com.datadog.api.client.v1.model.SLOCountSpec;
10+
import com.datadog.api.client.v1.model.SLODataSourceQueryDefinition;
11+
import com.datadog.api.client.v1.model.SLOFormula;
12+
import com.datadog.api.client.v1.model.SLOListResponse;
13+
import com.datadog.api.client.v1.model.SLOSliSpec;
14+
import com.datadog.api.client.v1.model.SLOThreshold;
15+
import com.datadog.api.client.v1.model.SLOTimeframe;
16+
import com.datadog.api.client.v1.model.SLOType;
17+
import com.datadog.api.client.v1.model.ServiceLevelObjectiveRequest;
18+
import java.util.Arrays;
19+
import java.util.Collections;
20+
21+
public class Example {
22+
public static void main(String[] args) {
23+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
24+
ServiceLevelObjectivesApi apiInstance = new ServiceLevelObjectivesApi(defaultClient);
25+
26+
ServiceLevelObjectiveRequest body =
27+
new ServiceLevelObjectiveRequest()
28+
.type(SLOType.METRIC)
29+
.description("Metric SLO using sli_specification")
30+
.name("Example-Service-Level-Objective")
31+
.sliSpecification(
32+
new SLOSliSpec(
33+
new SLOCountSpec()
34+
.count(
35+
new SLOCountDefinition()
36+
.goodEventsFormula(new SLOFormula().formula("query1 - query2"))
37+
.totalEventsFormula(new SLOFormula().formula("query1"))
38+
.queries(
39+
Arrays.asList(
40+
new SLODataSourceQueryDefinition(
41+
new FormulaAndFunctionMetricQueryDefinition()
42+
.dataSource(
43+
FormulaAndFunctionMetricDataSource.METRICS)
44+
.name("query1")
45+
.query("sum:httpservice.hits{*}.as_count()")),
46+
new SLODataSourceQueryDefinition(
47+
new FormulaAndFunctionMetricQueryDefinition()
48+
.dataSource(
49+
FormulaAndFunctionMetricDataSource.METRICS)
50+
.name("query2")
51+
.query("sum:httpservice.errors{*}.as_count()")))))))
52+
.tags(Arrays.asList("env:prod", "type:count"))
53+
.thresholds(
54+
Collections.singletonList(
55+
new SLOThreshold()
56+
.target(99.0)
57+
.targetDisplay("99.0")
58+
.timeframe(SLOTimeframe.SEVEN_DAYS)
59+
.warning(99.5)
60+
.warningDisplay("99.5")))
61+
.timeframe(SLOTimeframe.SEVEN_DAYS)
62+
.targetThreshold(99.0)
63+
.warningThreshold(99.5);
64+
65+
try {
66+
SLOListResponse result = apiInstance.createSLO(body);
67+
System.out.println(result);
68+
} catch (ApiException e) {
69+
System.err.println("Exception when calling ServiceLevelObjectivesApi#createSLO");
70+
System.err.println("Status code: " + e.getCode());
71+
System.err.println("Reason: " + e.getResponseBody());
72+
System.err.println("Response headers: " + e.getResponseHeaders());
73+
e.printStackTrace();
74+
}
75+
}
76+
}

examples/v2/test-optimization/SearchFlakyTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public static void main(String[] args) {
3131
"""
3232
flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"
3333
"""))
34-
.includeHistory(true)
3534
.page(
3635
new FlakyTestsSearchPageOptions()
3736
.cursor(

examples/v2/test-optimization/SearchFlakyTests_1224086727.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public static void main(String[] args) {
3131
"""
3232
flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"
3333
"""))
34-
.includeHistory(true)
3534
.page(
3635
new FlakyTestsSearchPageOptions()
3736
.cursor(

examples/v2/test-optimization/SearchFlakyTests_209064879.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)