From 0a1d55af1fffaf347ad22adcc8f6e1262ff570c7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 17 Mar 2026 20:23:54 +0000 Subject: [PATCH] Regenerate client from commit bd40a10 of spec repo --- .generator/schemas/v1/openapi.yaml | 64 ++++++++-- .generator/schemas/v2/openapi.yaml | 5 + .../frozen.json | 1 + .../recording.har | 110 ++++++++++++++++++ features/v1/service_level_objectives.feature | 15 ++- ...ObservabilityPipelineDatadogAgentSource.ts | 8 ++ .../service_level_objectives/src/v1/index.ts | 2 + .../src/v1/models/SLOCountDefinition.ts | 70 ++--------- .../SLOCountDefinitionWithBadEventsFormula.ts | 50 ++++++++ ...LOCountDefinitionWithTotalEventsFormula.ts | 50 ++++++++ .../src/v1/models/SLOCountSpec.ts | 5 +- .../src/v1/models/TypingInfo.ts | 12 +- 12 files changed, 315 insertions(+), 77 deletions(-) create mode 100644 cassettes/v1/Service-Level-Objectives_139838558/Create-a-new-metric-SLO-object-using-bad-events-formula-returns-OK-response_1739817425/frozen.json create mode 100644 cassettes/v1/Service-Level-Objectives_139838558/Create-a-new-metric-SLO-object-using-bad-events-formula-returns-OK-response_1739817425/recording.har create mode 100644 services/service_level_objectives/src/v1/models/SLOCountDefinitionWithBadEventsFormula.ts create mode 100644 services/service_level_objectives/src/v1/models/SLOCountDefinitionWithTotalEventsFormula.ts diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index daa9d89fc342..ea9665ada3d0 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -12338,33 +12338,73 @@ components: type: object SLOCountDefinition: description: 'A count-based (metric) SLI specification, composed of three parts: - the good events formula, the total events formula, + the good events formula, - and the underlying queries.' + the bad or total events formula, and the underlying queries. + + Exactly one of `total_events_formula` or `bad_events_formula` must be provided.' example: - good_events_formula: query1 - query2 + bad_events_formula: query2 + good_events_formula: query1 queries: - data_source: metrics name: query1 - query: sum:trace.servlet.request.hits{*} by {env}.as_count() + query: sum:trace.servlet.request.hits{!http.status_code:500} by {env}.as_count() - data_source: metrics name: query2 - query: sum:trace.servlet.request.errors{*} by {env}.as_count() - total_events_formula: query1 + query: sum:trace.servlet.request.hits{http.status_code:500} by {env}.as_count() + oneOf: + - $ref: '#/components/schemas/SLOCountDefinitionWithTotalEventsFormula' + - $ref: '#/components/schemas/SLOCountDefinitionWithBadEventsFormula' + SLOCountDefinitionWithBadEventsFormula: + additionalProperties: false properties: + bad_events_formula: + $ref: '#/components/schemas/SLOFormula' + description: The bad events formula (recommended). Total events queries + can be defined using the `total_events_formula` field as an alternative. + Only one of `total_events_formula` or `bad_events_formula` must be provided. good_events_formula: $ref: '#/components/schemas/SLOFormula' queries: example: - data_source: metrics name: query1 - query: sum:trace.servlet.request.hits{*} by {env}.as_count() + query: sum:trace.servlet.request.hits{!http.status_code:500} by {env}.as_count() + - data_source: metrics + name: query2 + query: sum:trace.servlet.request.hits{http.status_code:500} by {env}.as_count() + items: + $ref: '#/components/schemas/SLODataSourceQueryDefinition' + minItems: 1 + type: array + required: + - good_events_formula + - bad_events_formula + - queries + type: object + SLOCountDefinitionWithTotalEventsFormula: + additionalProperties: false + properties: + good_events_formula: + $ref: '#/components/schemas/SLOFormula' + queries: + example: + - data_source: metrics + name: query1 + query: sum:trace.servlet.request.hits{!http.status_code:500} by {env}.as_count() + - data_source: metrics + name: query2 + query: sum:trace.servlet.request.hits{http.status_code:500} by {env}.as_count() items: $ref: '#/components/schemas/SLODataSourceQueryDefinition' minItems: 1 type: array total_events_formula: $ref: '#/components/schemas/SLOFormula' + description: The total events formula. Bad events queries can be defined + using the `bad_events_formula` field as an alternative. Only one of `total_events_formula` + or `bad_events_formula` must be provided. required: - good_events_formula - total_events_formula @@ -12375,15 +12415,15 @@ components: description: A metric SLI specification. example: count: - good_events_formula: query1 - query2 + bad_events_formula: query2 + good_events_formula: query1 queries: - data_source: metrics name: query1 - query: sum:trace.servlet.request.hits{*} by {env}.as_count() + query: sum:trace.servlet.request.hits{!http.status_code:500} by {env}.as_count() - data_source: metrics name: query2 - query: sum:trace.servlet.request.errors{*} by {env}.as_count() - total_events_formula: query1 + query: sum:trace.servlet.request.hits{http.status_code:500} by {env}.as_count() properties: count: $ref: '#/components/schemas/SLOCountDefinition' @@ -13519,7 +13559,7 @@ components: name: query1 query: sum:trace.servlet.request.hits{*} by {env}.as_count() - data_source: metrics - name: query1 + name: query2 query: sum:trace.servlet.request.errors{*} by {env}.as_count() threshold: 5 properties: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 64f30b323064..adbf0e541590 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -42913,6 +42913,11 @@ components: **Supported pipeline types:** logs, metrics' properties: + address_key: + description: Name of the environment variable or secret that holds the listen + address for the Datadog Agent source. + example: DATADOG_AGENT_ADDRESS + type: string id: description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` diff --git a/cassettes/v1/Service-Level-Objectives_139838558/Create-a-new-metric-SLO-object-using-bad-events-formula-returns-OK-response_1739817425/frozen.json b/cassettes/v1/Service-Level-Objectives_139838558/Create-a-new-metric-SLO-object-using-bad-events-formula-returns-OK-response_1739817425/frozen.json new file mode 100644 index 000000000000..bf0999974b82 --- /dev/null +++ b/cassettes/v1/Service-Level-Objectives_139838558/Create-a-new-metric-SLO-object-using-bad-events-formula-returns-OK-response_1739817425/frozen.json @@ -0,0 +1 @@ +"2026-02-25T17:45:38.518Z" diff --git a/cassettes/v1/Service-Level-Objectives_139838558/Create-a-new-metric-SLO-object-using-bad-events-formula-returns-OK-response_1739817425/recording.har b/cassettes/v1/Service-Level-Objectives_139838558/Create-a-new-metric-SLO-object-using-bad-events-formula-returns-OK-response_1739817425/recording.har new file mode 100644 index 000000000000..e64286c3fd88 --- /dev/null +++ b/cassettes/v1/Service-Level-Objectives_139838558/Create-a-new-metric-SLO-object-using-bad-events-formula-returns-OK-response_1739817425/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Service Level Objectives/Create a new metric SLO object using bad events formula returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "d5693d5eee1eafa788d069277375e5d9", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 690, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 547, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":\"Metric SLO using sli_specification\",\"name\":\"Test-Create_a_new_metric_SLO_object_using_bad_events_formula_returns_OK_response-1772041538\",\"sli_specification\":{\"count\":{\"bad_events_formula\":{\"formula\":\"query2\"},\"good_events_formula\":{\"formula\":\"query1 - query2\"},\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"sum:httpservice.hits{*}.as_count()\"},{\"data_source\":\"metrics\",\"name\":\"query2\",\"query\":\"sum:httpservice.errors{*}.as_count()\"}]}},\"tags\":[\"env:prod\",\"type:count\"],\"target_threshold\":99,\"thresholds\":[{\"target\":99,\"target_display\":\"99.0\",\"timeframe\":\"7d\",\"warning\":99.5,\"warning_display\":\"99.5\"}],\"timeframe\":\"7d\",\"type\":\"metric\",\"warning_threshold\":99.5}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/slo" + }, + "response": { + "bodySize": 1196, + "content": { + "mimeType": "application/json", + "size": 1196, + "text": "{\"data\":[{\"id\":\"7309ff3752fd519f80f65a2ed3247dbb\",\"name\":\"Test-Create_a_new_metric_SLO_object_using_bad_events_formula_returns_OK_response-1772041538\",\"tags\":[\"env:prod\",\"type:count\"],\"monitor_tags\":[],\"thresholds\":[{\"timeframe\":\"7d\",\"target\":99.0,\"target_display\":\"99.\",\"warning\":99.5,\"warning_display\":\"99.5\"}],\"type\":\"metric\",\"type_id\":1,\"description\":\"Metric SLO using sli_specification\",\"timeframe\":\"7d\",\"warning_threshold\":99.5,\"target_threshold\":99,\"query\":{\"numerator\":\"sum:httpservice.hits{*}.as_count() - sum:httpservice.errors{*}.as_count()\",\"denominator\":\"(sum:httpservice.hits{*}.as_count() - sum:httpservice.errors{*}.as_count()) + (sum:httpservice.errors{*}.as_count())\"},\"creator\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\"},\"created_at\":1772041538,\"modified_at\":1772041538,\"sli_specification\":{\"count\":{\"bad_events_formula\":{\"formula\":\"query2\"},\"good_events_formula\":{\"formula\":\"query1 - query2\"},\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"sum:httpservice.hits{*}.as_count()\"},{\"data_source\":\"metrics\",\"name\":\"query2\",\"query\":\"sum:httpservice.errors{*}.as_count()\"}]}}}],\"error\":null}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 678, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-02-25T17:45:38.526Z", + "time": 172 + }, + { + "_id": "c0933b3f30b7b24a0ddbdcdf3c1ea62d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 528, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/slo/7309ff3752fd519f80f65a2ed3247dbb" + }, + "response": { + "bodySize": 59, + "content": { + "mimeType": "application/json", + "size": 59, + "text": "{\"data\":[\"7309ff3752fd519f80f65a2ed3247dbb\"],\"error\":null}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 674, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-02-25T17:45:38.707Z", + "time": 219 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/features/v1/service_level_objectives.feature b/features/v1/service_level_objectives.feature index 22c9d6cd3f91..6e756c5a54e3 100644 --- a/features/v1/service_level_objectives.feature +++ b/features/v1/service_level_objectives.feature @@ -48,6 +48,19 @@ Feature: Service Level Objectives When the request is sent Then the response status is 200 OK + @team:DataDog/slo-app + Scenario: Create a new metric SLO object using bad events formula returns "OK" response + Given new "CreateSLO" request + And body with value {"type":"metric","description":"Metric SLO using sli_specification","name":"{{ unique }}","sli_specification":{"count":{"good_events_formula":{"formula":"query1 - query2"},"bad_events_formula":{"formula":"query2"},"queries":[{"data_source":"metrics","name":"query1","query":"sum:httpservice.hits{*}.as_count()"},{"data_source":"metrics","name":"query2","query":"sum:httpservice.errors{*}.as_count()"}]}},"tags":["env:prod","type:count"],"thresholds":[{"target":99.0,"target_display":"99.0","timeframe":"7d","warning":99.5,"warning_display":"99.5"}],"timeframe":"7d","target_threshold":99.0,"warning_threshold":99.5} + When the request is sent + Then the response status is 200 OK + And the response "data[0]" has field "sli_specification" + And the response "data[0].sli_specification" has field "count" + And the response "data[0].sli_specification.count" has field "good_events_formula" + And the response "data[0].sli_specification.count" has field "bad_events_formula" + And the response "data[0].sli_specification.count" has field "queries" + And the response "data[0].sli_specification.count.queries" has length 2 + @team:DataDog/slo-app Scenario: Create a new metric SLO object using sli_specification returns "OK" response Given new "CreateSLO" request @@ -247,7 +260,7 @@ Feature: Service Level Objectives Scenario: Update an SLO returns "Not Found" response Given new "UpdateSLO" request And request contains "slo_id" parameter from "REPLACE.ME" - And body with value {"description": null, "groups": ["env:prod", "role:mysql"], "monitor_ids": [], "monitor_tags": [], "name": "Custom Metric SLO", "query": {"denominator": "sum:my.custom.metric{*}.as_count()", "numerator": "sum:my.custom.metric{type:good}.as_count()"}, "sli_specification": {"time_slice": {"comparator": "<", "query": {"formulas": [{"formula": "query2/query1"}], "queries": [{"data_source": "metrics", "name": "query1", "query": "sum:trace.servlet.request.hits{*} by {env}.as_count()"}, {"data_source": "metrics", "name": "query1", "query": "sum:trace.servlet.request.errors{*} by {env}.as_count()"}]}, "threshold": 5}}, "tags": ["env:prod", "app:core"], "target_threshold": 99.9, "thresholds": [{"target": 95, "timeframe": "7d"}, {"target": 95, "timeframe": "30d", "warning": 97}], "timeframe": "30d", "type": "metric", "warning_threshold": 99.95} + And body with value {"description": null, "groups": ["env:prod", "role:mysql"], "monitor_ids": [], "monitor_tags": [], "name": "Custom Metric SLO", "query": {"denominator": "sum:my.custom.metric{*}.as_count()", "numerator": "sum:my.custom.metric{type:good}.as_count()"}, "sli_specification": {"time_slice": {"comparator": "<", "query": {"formulas": [{"formula": "query2/query1"}], "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()"}]}, "threshold": 5}}, "tags": ["env:prod", "app:core"], "target_threshold": 99.9, "thresholds": [{"target": 95, "timeframe": "7d"}, {"target": 95, "timeframe": "30d", "warning": 97}], "timeframe": "30d", "type": "metric", "warning_threshold": 99.95} When the request is sent Then the response status is 404 Not Found diff --git a/services/observability_pipelines/src/v2/models/ObservabilityPipelineDatadogAgentSource.ts b/services/observability_pipelines/src/v2/models/ObservabilityPipelineDatadogAgentSource.ts index bfb2fcd4fb1a..cd642dd60990 100644 --- a/services/observability_pipelines/src/v2/models/ObservabilityPipelineDatadogAgentSource.ts +++ b/services/observability_pipelines/src/v2/models/ObservabilityPipelineDatadogAgentSource.ts @@ -9,6 +9,10 @@ import { ObservabilityPipelineTls } from "./ObservabilityPipelineTls"; * **Supported pipeline types:** logs, metrics */ export class ObservabilityPipelineDatadogAgentSource { + /** + * Name of the environment variable or secret that holds the listen address for the Datadog Agent source. + */ + "addressKey"?: string; /** * The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). */ @@ -36,6 +40,10 @@ export class ObservabilityPipelineDatadogAgentSource { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + addressKey: { + baseName: "address_key", + type: "string", + }, id: { baseName: "id", type: "string", diff --git a/services/service_level_objectives/src/v1/index.ts b/services/service_level_objectives/src/v1/index.ts index 4ad15470cc7f..f3a8cd6c4463 100644 --- a/services/service_level_objectives/src/v1/index.ts +++ b/services/service_level_objectives/src/v1/index.ts @@ -50,6 +50,8 @@ export { SLOCorrectionResponseAttributes } from "./models/SLOCorrectionResponseA export { SLOCorrectionResponseAttributesModifier } from "./models/SLOCorrectionResponseAttributesModifier"; export { SLOCorrectionType } from "./models/SLOCorrectionType"; export { SLOCountDefinition } from "./models/SLOCountDefinition"; +export { SLOCountDefinitionWithBadEventsFormula } from "./models/SLOCountDefinitionWithBadEventsFormula"; +export { SLOCountDefinitionWithTotalEventsFormula } from "./models/SLOCountDefinitionWithTotalEventsFormula"; export { SLOCountSpec } from "./models/SLOCountSpec"; export { SLOCreator } from "./models/SLOCreator"; export { SLODataSourceQueryDefinition } from "./models/SLODataSourceQueryDefinition"; diff --git a/services/service_level_objectives/src/v1/models/SLOCountDefinition.ts b/services/service_level_objectives/src/v1/models/SLOCountDefinition.ts index e52b003b0e8b..c81712d3e1da 100644 --- a/services/service_level_objectives/src/v1/models/SLOCountDefinition.ts +++ b/services/service_level_objectives/src/v1/models/SLOCountDefinition.ts @@ -1,64 +1,14 @@ -import { AttributeTypeMap } from "@datadog/datadog-api-client"; +import { UnparsedObject } from "@datadog/datadog-api-client"; -import { SLODataSourceQueryDefinition } from "./SLODataSourceQueryDefinition"; -import { SLOFormula } from "./SLOFormula"; +import { SLOCountDefinitionWithBadEventsFormula } from "./SLOCountDefinitionWithBadEventsFormula"; +import { SLOCountDefinitionWithTotalEventsFormula } from "./SLOCountDefinitionWithTotalEventsFormula"; /** - * A count-based (metric) SLI specification, composed of three parts: the good events formula, the total events formula, - * and the underlying queries. + * A count-based (metric) SLI specification, composed of three parts: the good events formula, + * the bad or total events formula, and the underlying queries. + * Exactly one of `total_events_formula` or `bad_events_formula` must be provided. */ -export class SLOCountDefinition { - /** - * 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 SLOCountDefinition.attributeTypeMap; - } - - public constructor() {} -} +export type SLOCountDefinition = + | SLOCountDefinitionWithTotalEventsFormula + | SLOCountDefinitionWithBadEventsFormula + | UnparsedObject; diff --git a/services/service_level_objectives/src/v1/models/SLOCountDefinitionWithBadEventsFormula.ts b/services/service_level_objectives/src/v1/models/SLOCountDefinitionWithBadEventsFormula.ts new file mode 100644 index 000000000000..e7e4d8a5ac92 --- /dev/null +++ b/services/service_level_objectives/src/v1/models/SLOCountDefinitionWithBadEventsFormula.ts @@ -0,0 +1,50 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SLODataSourceQueryDefinition } from "./SLODataSourceQueryDefinition"; +import { SLOFormula } from "./SLOFormula"; + +export class SLOCountDefinitionWithBadEventsFormula { + /** + * A formula that specifies how to combine the results of multiple queries. + */ + "badEventsFormula": SLOFormula; + /** + * A formula that specifies how to combine the results of multiple queries. + */ + "goodEventsFormula": SLOFormula; + "queries": Array; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + badEventsFormula: { + baseName: "bad_events_formula", + type: "SLOFormula", + required: true, + }, + goodEventsFormula: { + baseName: "good_events_formula", + type: "SLOFormula", + required: true, + }, + queries: { + baseName: "queries", + type: "Array", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SLOCountDefinitionWithBadEventsFormula.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/service_level_objectives/src/v1/models/SLOCountDefinitionWithTotalEventsFormula.ts b/services/service_level_objectives/src/v1/models/SLOCountDefinitionWithTotalEventsFormula.ts new file mode 100644 index 000000000000..7a210909fcde --- /dev/null +++ b/services/service_level_objectives/src/v1/models/SLOCountDefinitionWithTotalEventsFormula.ts @@ -0,0 +1,50 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SLODataSourceQueryDefinition } from "./SLODataSourceQueryDefinition"; +import { SLOFormula } from "./SLOFormula"; + +export class SLOCountDefinitionWithTotalEventsFormula { + /** + * 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; + /** + * @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, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SLOCountDefinitionWithTotalEventsFormula.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/service_level_objectives/src/v1/models/SLOCountSpec.ts b/services/service_level_objectives/src/v1/models/SLOCountSpec.ts index e36ed5f4a955..77ab6b72a2d9 100644 --- a/services/service_level_objectives/src/v1/models/SLOCountSpec.ts +++ b/services/service_level_objectives/src/v1/models/SLOCountSpec.ts @@ -7,8 +7,9 @@ import { SLOCountDefinition } from "./SLOCountDefinition"; */ export class SLOCountSpec { /** - * A count-based (metric) SLI specification, composed of three parts: the good events formula, the total events formula, - * and the underlying queries. + * A count-based (metric) SLI specification, composed of three parts: the good events formula, + * the bad or total events formula, and the underlying queries. + * Exactly one of `total_events_formula` or `bad_events_formula` must be provided. */ "count": SLOCountDefinition; /** diff --git a/services/service_level_objectives/src/v1/models/TypingInfo.ts b/services/service_level_objectives/src/v1/models/TypingInfo.ts index 88d8f9715ba1..059aadfee640 100644 --- a/services/service_level_objectives/src/v1/models/TypingInfo.ts +++ b/services/service_level_objectives/src/v1/models/TypingInfo.ts @@ -14,7 +14,8 @@ import { SLOCorrection } from "./SLOCorrection"; import { SLOCorrectionListResponse } from "./SLOCorrectionListResponse"; import { SLOCorrectionResponseAttributes } from "./SLOCorrectionResponseAttributes"; import { SLOCorrectionResponseAttributesModifier } from "./SLOCorrectionResponseAttributesModifier"; -import { SLOCountDefinition } from "./SLOCountDefinition"; +import { SLOCountDefinitionWithBadEventsFormula } from "./SLOCountDefinitionWithBadEventsFormula"; +import { SLOCountDefinitionWithTotalEventsFormula } from "./SLOCountDefinitionWithTotalEventsFormula"; import { SLOCountSpec } from "./SLOCountSpec"; import { SLOCreator } from "./SLOCreator"; import { SLODeleteResponse } from "./SLODeleteResponse"; @@ -90,6 +91,10 @@ export const TypingInfo: ModelTypingInfo = { SearchSLOTimeframe: ["7d", "30d", "90d"], }, oneOfMap: { + SLOCountDefinition: [ + "SLOCountDefinitionWithTotalEventsFormula", + "SLOCountDefinitionWithBadEventsFormula", + ], SLODataSourceQueryDefinition: ["FormulaAndFunctionMetricQueryDefinition"], SLOSliSpec: ["SLOTimeSliceSpec", "SLOCountSpec"], }, @@ -110,7 +115,10 @@ export const TypingInfo: ModelTypingInfo = { SLOCorrectionResponseAttributes: SLOCorrectionResponseAttributes, SLOCorrectionResponseAttributesModifier: SLOCorrectionResponseAttributesModifier, - SLOCountDefinition: SLOCountDefinition, + SLOCountDefinitionWithBadEventsFormula: + SLOCountDefinitionWithBadEventsFormula, + SLOCountDefinitionWithTotalEventsFormula: + SLOCountDefinitionWithTotalEventsFormula, SLOCountSpec: SLOCountSpec, SLOCreator: SLOCreator, SLODeleteResponse: SLODeleteResponse,