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
85 changes: 82 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11481,6 +11481,60 @@ components:
example: UTC
type: string
type: object
SLOCountCondition:
description: 'A metric 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.hits{*} by {env}.as_count()
- data_source: metrics
name: query2
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
total_events_formula: query1
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 metric SLI specification.
example:
count:
good_events_formula: query1 - query2
queries:
- data_source: metrics
name: query1
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
- data_source: metrics
name: query2
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
total_events_formula: query1
properties:
count:
$ref: '#/components/schemas/SLOCountCondition'
required:
- count
type: object
SLOCreator:
description: The creator of the SLO
nullable: true
Expand Down Expand Up @@ -12328,8 +12382,16 @@ components:
type: string
query:
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
description: 'The metric query of good / total events. This is not allowed
if the `sli_specification` field

is used in the same request.'
sli_specification:
$ref: '#/components/schemas/SLOSliSpec'
description: 'A generic SLI specification. This is currently used for time-slice
and metric SLOs only.

This is not allowed if the `query` field is used in the same request.'
tags:
description: 'A list of tags associated with this service level objective.

Expand Down Expand Up @@ -12386,9 +12448,10 @@ components:
type: object
SLOSliSpec:
description: A generic SLI specification. This is currently used for time-slice
SLOs only.
and metric SLOs only.
oneOf:
- $ref: '#/components/schemas/SLOTimeSliceSpec'
- $ref: '#/components/schemas/SLOCountSpec'
SLOState:
description: State of the SLO.
enum:
Expand Down Expand Up @@ -13479,8 +13542,16 @@ components:
type: string
query:
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
description: 'The metric query of good / total events. This is not allowed
if the `sli_specification` field

is used in the same request.'
sli_specification:
$ref: '#/components/schemas/SLOSliSpec'
description: 'A generic SLI specification. This is currently used for time-slice
and metric SLOs only.

This is not allowed if the `query` field is used in the same request.'
tags:
description: 'A list of tags associated with this service level objective.

Expand Down Expand Up @@ -13540,8 +13611,8 @@ 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 now deprecated metric 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 Expand Up @@ -13610,8 +13681,16 @@ components:
type: string
query:
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
description: 'The metric query of good / total events. This is not allowed
if the `sli_specification` field

is used in the same request.'
sli_specification:
$ref: '#/components/schemas/SLOSliSpec'
description: 'A generic SLI specification. This is currently used for time-slice
and metric SLOs only.

This is not allowed if the `query` field is used in the same request.'
tags:
description: 'A list of tags associated with this service level objective.

Expand Down
2 changes: 2 additions & 0 deletions packages/datadog-api-client-v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,8 @@ export { SLOCorrectionType } from "./models/SLOCorrectionType";
export { SLOCorrectionUpdateData } from "./models/SLOCorrectionUpdateData";
export { SLOCorrectionUpdateRequest } from "./models/SLOCorrectionUpdateRequest";
export { SLOCorrectionUpdateRequestAttributes } from "./models/SLOCorrectionUpdateRequestAttributes";
export { SLOCountCondition } from "./models/SLOCountCondition";
export { SLOCountSpec } from "./models/SLOCountSpec";
export { SLOCreator } from "./models/SLOCreator";
export { SLODataSourceQueryDefinition } from "./models/SLODataSourceQueryDefinition";
export { SLODeleteResponse } from "./models/SLODeleteResponse";
Expand Down
6 changes: 5 additions & 1 deletion packages/datadog-api-client-v1/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ import { SLOCorrectionResponseAttributesModifier } from "./SLOCorrectionResponse
import { SLOCorrectionUpdateData } from "./SLOCorrectionUpdateData";
import { SLOCorrectionUpdateRequest } from "./SLOCorrectionUpdateRequest";
import { SLOCorrectionUpdateRequestAttributes } from "./SLOCorrectionUpdateRequestAttributes";
import { SLOCountCondition } from "./SLOCountCondition";
import { SLOCountSpec } from "./SLOCountSpec";
import { SLOCreator } from "./SLOCreator";
import { SLODeleteResponse } from "./SLODeleteResponse";
import { SLOFormula } from "./SLOFormula";
Expand Down Expand Up @@ -2072,6 +2074,8 @@ const typeMap: { [index: string]: any } = {
SLOCorrectionUpdateData: SLOCorrectionUpdateData,
SLOCorrectionUpdateRequest: SLOCorrectionUpdateRequest,
SLOCorrectionUpdateRequestAttributes: SLOCorrectionUpdateRequestAttributes,
SLOCountCondition: SLOCountCondition,
SLOCountSpec: SLOCountSpec,
SLOCreator: SLOCreator,
SLODeleteResponse: SLODeleteResponse,
SLOFormula: SLOFormula,
Expand Down Expand Up @@ -2510,7 +2514,7 @@ const oneOfMap: { [index: string]: string[] } = {
],
NumberFormatUnit: ["NumberFormatUnitCanonical", "NumberFormatUnitCustom"],
SLODataSourceQueryDefinition: ["FormulaAndFunctionMetricQueryDefinition"],
SLOSliSpec: ["SLOTimeSliceSpec"],
SLOSliSpec: ["SLOTimeSliceSpec", "SLOCountSpec"],
SharedDashboardInvitesData: [
"SharedDashboardInvitesDataObject",
"Array<SharedDashboardInvitesDataObject>",
Expand Down
71 changes: 71 additions & 0 deletions packages/datadog-api-client-v1/models/SLOCountCondition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { SLODataSourceQueryDefinition } from "./SLODataSourceQueryDefinition";
import { SLOFormula } from "./SLOFormula";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* A metric SLI specification, composed of three parts: the good events formula, the total events formula,
* and the involved queries.
*/
export class SLOCountCondition {
/**
* A formula that specifies how to combine the results of multiple queries.
*/
"goodEventsFormula": SLOFormula;
"queries": Array<SLODataSourceQueryDefinition>;
/**
* A formula that specifies how to combine the results of multiple queries.
*/
"totalEventsFormula": SLOFormula;

/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
"additionalProperties"?: { [key: string]: any };

/**
* @ignore
*/
"_unparsed"?: boolean;

/**
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
goodEventsFormula: {
baseName: "good_events_formula",
type: "SLOFormula",
required: true,
},
queries: {
baseName: "queries",
type: "Array<SLODataSourceQueryDefinition>",
required: true,
},
totalEventsFormula: {
baseName: "total_events_formula",
type: "SLOFormula",
required: true,
},
additionalProperties: {
baseName: "additionalProperties",
type: "{ [key: string]: any; }",
},
};

/**
* @ignore
*/
static getAttributeTypeMap(): AttributeTypeMap {
return SLOCountCondition.attributeTypeMap;
}

public constructor() {}
}
44 changes: 44 additions & 0 deletions packages/datadog-api-client-v1/models/SLOCountSpec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { SLOCountCondition } from "./SLOCountCondition";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* A metric SLI specification.
*/
export class SLOCountSpec {
/**
* A metric SLI specification, composed of three parts: the good events formula, the total events formula,
* and the involved queries.
*/
"count": SLOCountCondition;

/**
* @ignore
*/
"_unparsed"?: boolean;

/**
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
count: {
baseName: "count",
type: "SLOCountCondition",
required: true,
},
};

/**
* @ignore
*/
static getAttributeTypeMap(): AttributeTypeMap {
return SLOCountSpec.attributeTypeMap;
}

public constructor() {}
}
4 changes: 2 additions & 2 deletions packages/datadog-api-client-v1/models/SLOResponseData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ export class SLOResponseData {
*/
"name"?: string;
/**
* A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator
* A now deprecated metric 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
* min of all of those requests.
*/
"query"?: ServiceLevelObjectiveQuery;
/**
* A generic SLI specification. This is currently used for time-slice SLOs only.
* A generic SLI specification. This is currently used for time-slice and metric SLOs only.
*/
"sliSpecification"?: SLOSliSpec;
/**
Expand Down
5 changes: 3 additions & 2 deletions packages/datadog-api-client-v1/models/SLOSliSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { SLOCountSpec } from "./SLOCountSpec";
import { SLOTimeSliceSpec } from "./SLOTimeSliceSpec";

import { UnparsedObject } from "../../datadog-api-client-common/util";

/**
* A generic SLI specification. This is currently used for time-slice SLOs only.
* A generic SLI specification. This is currently used for time-slice and metric SLOs only.
*/

export type SLOSliSpec = SLOTimeSliceSpec | UnparsedObject;
export type SLOSliSpec = SLOTimeSliceSpec | SLOCountSpec | UnparsedObject;
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ export class ServiceLevelObjective {
*/
"name": string;
/**
* A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator
* A now deprecated metric 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
* min of all of those requests.
*/
"query"?: ServiceLevelObjectiveQuery;
/**
* A generic SLI specification. This is currently used for time-slice SLOs only.
* A generic SLI specification. This is currently used for time-slice and metric SLOs only.
*/
"sliSpecification"?: SLOSliSpec;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator
* A now deprecated metric 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
* min of all of those requests.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export class ServiceLevelObjectiveRequest {
*/
"name": string;
/**
* A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator
* A now deprecated metric 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
* min of all of those requests.
*/
"query"?: ServiceLevelObjectiveQuery;
/**
* A generic SLI specification. This is currently used for time-slice SLOs only.
* A generic SLI specification. This is currently used for time-slice and metric SLOs only.
*/
"sliSpecification"?: SLOSliSpec;
/**
Expand Down