Skip to content
Open
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
13 changes: 6 additions & 7 deletions content/en/api/v1/service-level-objectives/examples.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"type": "metric",
"description": "Metric SLO using sli_specification",
"name": "Example-Service-Level-Objective",
"sli_specification": {
"count": {
"good_events_formula": {
"formula": "query1"
},
"total_events_formula": {
"formula": "query2"
},
"queries": [
{
"data_source": "metrics",
"name": "query1",
"query": "sum:httpservice.success{*}.as_count()"
},
{
"data_source": "metrics",
"name": "query2",
"query": "sum:httpservice.hits{*}.as_count()"
}
]
}
},
"tags": [
"env:prod",
"type:count"
],
"thresholds": [
{
"target": 99.0,
"target_display": "99.0",
"timeframe": "7d",
"warning": 98,
"warning_display": "98.0"
}
],
"timeframe": "7d",
"target_threshold": 99.0,
"warning_threshold": 98
}
5 changes: 5 additions & 0 deletions data/api/v1/CodeExamples.json
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,11 @@
}
],
"CreateSLO": [
{
"group": "service_level_objectives",
"suffix": "_512760759",
"description": "Create a new metric SLO object using sli_specification returns \"OK\" response"
},
{
"group": "service_level_objectives",
"suffix": "_3765703239",
Expand Down
62 changes: 57 additions & 5 deletions data/api/v1/full_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11516,6 +11516,60 @@ components:
example: UTC
type: string
type: object
SLOCountCondition:
description: 'A count-based SLI specification, composed of three parts: the
good events formula, the total events formula,

and the involved queries.'
example:
good_events_formula: query1 - query2
queries:
- data_source: metrics
name: query1
query: sum:trace.servlet.request.success{*} by {env}.as_count()
- data_source: metrics
name: query2
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
total_events_formula: query2
properties:
good_events_formula:
$ref: '#/components/schemas/SLOFormula'
queries:
example:
- data_source: metrics
name: query1
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
items:
$ref: '#/components/schemas/SLODataSourceQueryDefinition'
minItems: 1
type: array
total_events_formula:
$ref: '#/components/schemas/SLOFormula'
required:
- good_events_formula
- total_events_formula
- queries
type: object
SLOCountSpec:
additionalProperties: false
description: A count-based SLI specification.
example:
count:
good_events_formula: query1 - query2
queries:
- data_source: metrics
name: query1
query: sum:trace.servlet.request.success{*} by {env}.as_count()
- data_source: metrics
name: query2
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
total_events_formula: query2
properties:
count:
$ref: '#/components/schemas/SLOCountCondition'
required:
- count
type: object
SLOCreator:
description: The creator of the SLO
nullable: true
Expand Down Expand Up @@ -12402,8 +12456,6 @@ components:
type: array
timeframe:
$ref: '#/components/schemas/SLOTimeframe'
type:
$ref: '#/components/schemas/SLOType'
warning_threshold:
description: 'The optional warning threshold such that when the service
level indicator is
Expand All @@ -12421,9 +12473,10 @@ components:
type: object
SLOSliSpec:
description: A generic SLI specification. This is currently used for time-slice
SLOs only.
and count-based SLOs only.
oneOf:
- $ref: '#/components/schemas/SLOTimeSliceSpec'
- $ref: '#/components/schemas/SLOCountSpec'
SLOState:
description: State of the SLO.
enum:
Expand Down Expand Up @@ -13606,8 +13659,7 @@ components:
- type
type: object
ServiceLevelObjectiveQuery:
description: 'A metric-based SLO. **Required if type is `metric`**. Note that
Datadog only allows the sum by aggregator
description: 'A metric-based SLO. Note that Datadog only allows the sum by aggregator

to be used because this will sum up all request counts instead of averaging
them, or taking the max or
Expand Down
Loading