Skip to content

Commit a588c7c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Changed Metric SLO to support SLI specification (#2964)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 3e8a019 commit a588c7c

File tree

39 files changed

+848
-341
lines changed

39 files changed

+848
-341
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 63 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,12 @@ components:
1274712801
type: string
1274812802
query:
1274912803
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
12804+
description: The metric query used to define a count-based SLO as the ratio
12805+
of good events to total events.
1275012806
sli_specification:
1275112807
$ref: '#/components/schemas/SLOSliSpec'
12808+
description: A generic SLI specification. This is currently used for time-slice
12809+
and count-based (metric) SLOs only.
1275212810
tags:
1275312811
description: 'A list of tags associated with this service level objective.
1275412812

@@ -12804,10 +12862,11 @@ components:
1280412862
type: number
1280512863
type: object
1280612864
SLOSliSpec:
12807-
description: A generic SLI specification. This is currently used for time-slice
12808-
SLOs only.
12865+
description: A generic SLI specification. This is used for time-slice and count-based
12866+
(metric) SLOs only.
1280912867
oneOf:
1281012868
- $ref: '#/components/schemas/SLOTimeSliceSpec'
12869+
- $ref: '#/components/schemas/SLOCountSpec'
1281112870
SLOState:
1281212871
description: State of the SLO.
1281312872
enum:
@@ -13959,7 +14018,8 @@ components:
1395914018
- type
1396014019
type: object
1396114020
ServiceLevelObjectiveQuery:
13962-
description: 'A metric-based SLO. **Required if type is `metric`**. Note that
14021+
description: 'A count-based (metric) SLO query. This field is superseded by
14022+
`sli_specification` but is retained for backwards compatibility. Note that
1396314023
Datadog only allows the sum by aggregator
1396414024

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

0 commit comments

Comments
 (0)