diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index afb32a4a89a0..f640568bf286 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -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 @@ -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. @@ -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: @@ -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. @@ -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 @@ -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. diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 5b22314e3126..951fdf6b9c7a 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -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"; diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 0aa318305ba7..d5bf99e54f71 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -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"; @@ -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, @@ -2510,7 +2514,7 @@ const oneOfMap: { [index: string]: string[] } = { ], NumberFormatUnit: ["NumberFormatUnitCanonical", "NumberFormatUnitCustom"], SLODataSourceQueryDefinition: ["FormulaAndFunctionMetricQueryDefinition"], - SLOSliSpec: ["SLOTimeSliceSpec"], + SLOSliSpec: ["SLOTimeSliceSpec", "SLOCountSpec"], SharedDashboardInvitesData: [ "SharedDashboardInvitesDataObject", "Array", diff --git a/packages/datadog-api-client-v1/models/SLOCountCondition.ts b/packages/datadog-api-client-v1/models/SLOCountCondition.ts new file mode 100644 index 000000000000..9bb9211faa77 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOCountCondition.ts @@ -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; + /** + * 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", + 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() {} +} diff --git a/packages/datadog-api-client-v1/models/SLOCountSpec.ts b/packages/datadog-api-client-v1/models/SLOCountSpec.ts new file mode 100644 index 000000000000..256cc0c9342d --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOCountSpec.ts @@ -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() {} +} diff --git a/packages/datadog-api-client-v1/models/SLOResponseData.ts b/packages/datadog-api-client-v1/models/SLOResponseData.ts index add999e195a6..fb7499f2af67 100644 --- a/packages/datadog-api-client-v1/models/SLOResponseData.ts +++ b/packages/datadog-api-client-v1/models/SLOResponseData.ts @@ -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; /** diff --git a/packages/datadog-api-client-v1/models/SLOSliSpec.ts b/packages/datadog-api-client-v1/models/SLOSliSpec.ts index f8b2d08b3ef1..c7b0ca87cb17 100644 --- a/packages/datadog-api-client-v1/models/SLOSliSpec.ts +++ b/packages/datadog-api-client-v1/models/SLOSliSpec.ts @@ -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; diff --git a/packages/datadog-api-client-v1/models/ServiceLevelObjective.ts b/packages/datadog-api-client-v1/models/ServiceLevelObjective.ts index 17f6589ab139..dcb60c7faf27 100644 --- a/packages/datadog-api-client-v1/models/ServiceLevelObjective.ts +++ b/packages/datadog-api-client-v1/models/ServiceLevelObjective.ts @@ -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; /** diff --git a/packages/datadog-api-client-v1/models/ServiceLevelObjectiveQuery.ts b/packages/datadog-api-client-v1/models/ServiceLevelObjectiveQuery.ts index b736c33bb854..90b4fd492fc8 100644 --- a/packages/datadog-api-client-v1/models/ServiceLevelObjectiveQuery.ts +++ b/packages/datadog-api-client-v1/models/ServiceLevelObjectiveQuery.ts @@ -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. */ diff --git a/packages/datadog-api-client-v1/models/ServiceLevelObjectiveRequest.ts b/packages/datadog-api-client-v1/models/ServiceLevelObjectiveRequest.ts index d49653e96a3b..c1ac946c3f74 100644 --- a/packages/datadog-api-client-v1/models/ServiceLevelObjectiveRequest.ts +++ b/packages/datadog-api-client-v1/models/ServiceLevelObjectiveRequest.ts @@ -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; /**