Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Overall Status support to SLO Search API #830

Merged
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2022-09-12 15:22:05.725204",
"spec_repo_commit": "dcd92077"
"regenerated": "2022-09-13 07:28:13.750530",
"spec_repo_commit": "82fabb35"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-09-12 15:22:05.740102",
"spec_repo_commit": "dcd92077"
"regenerated": "2022-09-13 07:28:13.767666",
"spec_repo_commit": "82fabb35"
}
}
}
289 changes: 284 additions & 5 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8696,6 +8696,20 @@ components:
example: UTC
type: string
type: object
SLOCreator:
description: The creator of the SLO
nullable: true
properties:
email:
description: Email of the creator.
type: string
id:
description: User ID of the creator.
type: string
name:
description: Name of the creator.
type: string
type: object
SLODeleteResponse:
description: A response list of all service level objective deleted.
properties:
Expand Down Expand Up @@ -9206,6 +9220,55 @@ components:
format: int64
type: integer
type: object
SLOOverallStatuses:
description: Overall status of the SLO by timeframes.
properties:
error:
description: Error message if SLO status or error budget could not be calculated.
nullable: true
type: string
indexed_at:
description: 'timestamp (UNIX time in seconds) of when the SLO status and
error budget

were calculated.'
example: 1662496260
format: int64
type: integer
raw_error_budget_remaining:
$ref: '#/components/schemas/SLORawErrorBudgetRemaining'
span_precision:
description: The amount of decimal places the SLI value is accurate to.
example: 2
format: int64
type: integer
status:
description: The status of the SLO.
example: 100
format: double
nullable: true
type: number
target:
description: The target of the SLO.
example: 99
format: double
type: number
timeframe:
$ref: '#/components/schemas/SLOTimeframe'
type: object
SLORawErrorBudgetRemaining:
description: Error budget remaining for an SLO.
properties:
unit:
description: Error budget remaining unit.
example: requests
type: string
value:
description: Error budget remaining value.
example: 60
format: double
type: number
type: object
SLOResponse:
description: A service level objective response containing a single service
level objective.
Expand Down Expand Up @@ -9643,6 +9706,38 @@ components:
- formula
- dimension
type: object
SearchSLOQuery:
description: 'A metric-based SLO. **Required if type is `metric`**. 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

min of all of those requests.'
nullable: true
properties:
denominator:
description: A Datadog metric query for total (valid) events.
example: sum:my.custom.metric{*}.as_count()
type: string
metrics:
description: 'Metric names used in the query''s numerator and denominator.

This field will return null and will be implemented in the next version
of this endpoint.'
example:
- my.custom.metric
- my.other.custom.metric
items:
description: Metric name.
type: string
nullable: true
type: array
numerator:
description: A Datadog metric query for good events.
example: sum:my.custom.metric{type:good}.as_count()
type: string
type: object
SearchSLOResponse:
description: A search SLO response containing results from the search query.
properties:
Expand Down Expand Up @@ -9671,7 +9766,7 @@ components:
slo:
description: SLOs
items:
$ref: '#/components/schemas/ServiceLevelObjective'
$ref: '#/components/schemas/SearchServiceLevelObjective'
type: array
type: object
SearchSLOResponseDataAttributesFacets:
Expand Down Expand Up @@ -9801,6 +9896,181 @@ components:
description: Type of pagination.
type: string
type: object
SearchSLOThreshold:
description: SLO thresholds (target and optionally warning) for a single time
window.
properties:
target:
description: 'The target value for the service level indicator within the
corresponding

timeframe.'
example: 99.9
format: double
type: number
target_display:
description: 'A string representation of the target that indicates its precision.

It uses trailing zeros to show significant decimal places (for example
`98.00`).


Always included in service level objective responses. Ignored in

create/update requests.'
example: '99.9'
type: string
timeframe:
$ref: '#/components/schemas/SearchSLOTimeframe'
warning:
description: The warning value for the service level objective.
example: 90.0
format: double
nullable: true
type: number
warning_display:
description: 'A string representation of the warning target (see the description
of

the `target_display` field for details).


Included in service level objective responses if a warning target exists.

Ignored in create/update requests.'
example: '90.0'
nullable: true
type: string
required:
- timeframe
- target
type: object
SearchSLOTimeframe:
description: The SLO time window options.
enum:
- 7d
- 30d
- 90d
example: 30d
type: string
x-enum-varnames:
- SEVEN_DAYS
- THIRTY_DAYS
- NINETY_DAYS
SearchServiceLevelObjective:
description: 'A service level objective object includes a service level indicator,
thresholds

for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.).'
properties:
all_tags:
description: 'A list of tags associated with this service level objective.

Always included in service level objective responses (but may be empty).

Optional in create/update requests.'
example:
- env:prod
- app:core
items:
description: A tag to apply to your SLO.
type: string
type: array
created_at:
description: 'Creation timestamp (UNIX time in seconds)


Always included in service level objective responses.'
format: int64
readOnly: true
type: integer
creator:
$ref: '#/components/schemas/SLOCreator'
description:
description: 'A user-defined description of the service level objective.


Always included in service level objective responses (but may be `null`).

Optional in create/update requests.'
nullable: true
type: string
groups:
description: 'A list of (up to 100) monitor groups that narrow the scope
of a monitor service level objective.


Included in service level objective responses if it is not empty. Optional
in

create/update requests for monitor service level objectives, but may only
be

used when then length of the `monitor_ids` field is one.'
example:
- env:prod
- role:mysql
items:
description: A group name, for instance `env:prod`.
type: string
nullable: true
type: array
id:
description: 'A unique identifier for the service level objective object.


Always included in service level objective responses.'
readOnly: true
type: string
modified_at:
description: 'Modification timestamp (UNIX time in seconds)


Always included in service level objective responses.'
format: int64
readOnly: true
type: integer
monitor_ids:
description: 'A list of monitor ids that defines the scope of a monitor
service level

objective. **Required if type is `monitor`**.'
items:
description: A monitor ID.
format: int64
type: integer
nullable: true
type: array
name:
description: The name of the service level objective object.
example: Custom Metric SLO
type: string
overall_status:
description: calculated status and error budget remaining.
items:
$ref: '#/components/schemas/SLOOverallStatuses'
type: array
query:
$ref: '#/components/schemas/SearchSLOQuery'
thresholds:
description: 'The thresholds (timeframes and associated targets) for this
service level

objective object.'
example:
- target: 95
target_display: '95'
timeframe: 7d
- target: 95
target_display: '95'
timeframe: 30d
warning: 97
warning_display: '97'
items:
$ref: '#/components/schemas/SearchSLOThreshold'
type: array
type:
$ref: '#/components/schemas/SLOType'
Series:
description: 'A metric to submit to Datadog.

Expand Down Expand Up @@ -24378,7 +24648,11 @@ paths:
description: Get a list of service level objective objects for your organization.
operationId: SearchSLO
parameters:
- description: The query string to filter results based on SLO names.
- description: 'The query string to filter results based on SLO names.

Some examples of queries include `service:<service-name>`

and `<slo-name>`.'
in: query
name: query
required: false
Expand All @@ -24399,6 +24673,12 @@ paths:
schema:
format: int64
type: integer
- description: Whether or not to return facet information in the response `[default=false]`.
in: query
name: include_facets
required: false
schema:
type: boolean
responses:
'200':
content:
Expand Down Expand Up @@ -24428,6 +24708,7 @@ paths:
description: The regional site for Datadog customers.
enum:
- datadoghq.com
- datadoghq.eu
- us3.datadoghq.com
- us5.datadoghq.com
- ddog-gov.com
Expand All @@ -24453,9 +24734,7 @@ paths:
summary: Search for SLOs
tags:
- Service Level Objectives
x-unstable: '**Note**: Note: This endpoint is in public beta for US regions.

It is not currently supported in the EU region.
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v1/slo/{slo_id}:
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client-common/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const operationServers: {
new ServerConfiguration<{
site:
| "datadoghq.com"
| "datadoghq.eu"
| "us3.datadoghq.com"
| "us5.datadoghq.com"
| "ddog-gov.com";
Expand Down
Loading