diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 00e155de3b0ce..818f4a0bfe273 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -70921,6 +70921,18 @@ components: - $ref: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' - $ref: '#/components/schemas/SLOs_timeslice_metric_percentile_metric' - $ref: '#/components/schemas/SLOs_timeslice_metric_doc_count_metric' + discriminator: + mapping: + avg: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + cardinality: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + doc_count: '#/components/schemas/SLOs_timeslice_metric_doc_count_metric' + last_value: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + max: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + min: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + percentile: '#/components/schemas/SLOs_timeslice_metric_percentile_metric' + std_deviation: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + sum: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + propertyName: aggregation type: array threshold: description: The threshold used to determine if the metric is a good slice or not. diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index b0b0ffa135723..e0a7108f4fdf2 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -80512,6 +80512,18 @@ components: - $ref: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' - $ref: '#/components/schemas/SLOs_timeslice_metric_percentile_metric' - $ref: '#/components/schemas/SLOs_timeslice_metric_doc_count_metric' + discriminator: + mapping: + avg: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + cardinality: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + doc_count: '#/components/schemas/SLOs_timeslice_metric_doc_count_metric' + last_value: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + max: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + min: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + percentile: '#/components/schemas/SLOs_timeslice_metric_percentile_metric' + std_deviation: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + sum: '#/components/schemas/SLOs_timeslice_metric_basic_metric_with_field' + propertyName: aggregation type: array threshold: description: The threshold used to determine if the metric is a good slice or not. diff --git a/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.json b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.json index 656529c3eb55e..4c92310f929aa 100644 --- a/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.json +++ b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.json @@ -1768,12 +1768,13 @@ } } }, - "timeslice_metric_basic_metric_with_field": { - "title": "Timeslice Metric Basic Metric with Field", + "timeslice_metric_percentile_metric": { + "title": "Timeslice Metric Percentile Metric", "required": [ "name", "aggregation", - "field" + "field", + "percentile" ], "type": "object", "properties": { @@ -1784,17 +1785,11 @@ "pattern": "^[A-Z]$" }, "aggregation": { - "description": "The aggregation type of the metric.", + "description": "The aggregation type of the metric. Only valid option is \"percentile\"", "type": "string", - "example": "sum", + "example": "percentile", "enum": [ - "sum", - "avg", - "min", - "max", - "std_deviation", - "last_value", - "cardinality" + "percentile" ] }, "field": { @@ -1802,6 +1797,11 @@ "type": "string", "example": "processor.processed" }, + "percentile": { + "description": "The percentile value.", + "type": "number", + "example": 95 + }, "filter": { "description": "The filter to apply to the metric.", "type": "string", @@ -1809,13 +1809,11 @@ } } }, - "timeslice_metric_percentile_metric": { - "title": "Timeslice Metric Percentile Metric", + "timeslice_metric_doc_count_metric": { + "title": "Timeslice Metric Doc Count Metric", "required": [ "name", - "aggregation", - "field", - "percentile" + "aggregation" ], "type": "object", "properties": { @@ -1826,23 +1824,13 @@ "pattern": "^[A-Z]$" }, "aggregation": { - "description": "The aggregation type of the metric. Only valid option is \"percentile\"", + "description": "The aggregation type of the metric. Only valid option is \"doc_count\"", "type": "string", - "example": "percentile", + "example": "doc_count", "enum": [ - "percentile" + "doc_count" ] }, - "field": { - "description": "The field of the metric.", - "type": "string", - "example": "processor.processed" - }, - "percentile": { - "description": "The percentile value.", - "type": "number", - "example": 95 - }, "filter": { "description": "The filter to apply to the metric.", "type": "string", @@ -1850,11 +1838,12 @@ } } }, - "timeslice_metric_doc_count_metric": { - "title": "Timeslice Metric Doc Count Metric", + "timeslice_metric_basic_metric_with_field": { + "title": "Timeslice Metric Basic Metric with Field", "required": [ "name", - "aggregation" + "aggregation", + "field" ], "type": "object", "properties": { @@ -1865,13 +1854,24 @@ "pattern": "^[A-Z]$" }, "aggregation": { - "description": "The aggregation type of the metric. Only valid option is \"doc_count\"", + "description": "The aggregation type of the metric.", "type": "string", - "example": "doc_count", + "example": "sum", "enum": [ - "doc_count" + "sum", + "avg", + "min", + "max", + "std_deviation", + "last_value", + "cardinality" ] }, + "field": { + "description": "The field of the metric.", + "type": "string", + "example": "processor.processed" + }, "filter": { "description": "The filter to apply to the metric.", "type": "string", @@ -1932,6 +1932,20 @@ "description": "List of metrics with their name, aggregation type, and field.", "type": "array", "items": { + "discriminator": { + "propertyName": "aggregation", + "mapping": { + "percentile": "#/components/schemas/timeslice_metric_percentile_metric", + "doc_count": "#/components/schemas/timeslice_metric_doc_count_metric", + "sum": "#/components/schemas/timeslice_metric_basic_metric_with_field", + "avg": "#/components/schemas/timeslice_metric_basic_metric_with_field", + "min": "#/components/schemas/timeslice_metric_basic_metric_with_field", + "max": "#/components/schemas/timeslice_metric_basic_metric_with_field", + "std_deviation": "#/components/schemas/timeslice_metric_basic_metric_with_field", + "last_value": "#/components/schemas/timeslice_metric_basic_metric_with_field", + "cardinality": "#/components/schemas/timeslice_metric_basic_metric_with_field" + } + }, "anyOf": [ { "$ref": "#/components/schemas/timeslice_metric_basic_metric_with_field" diff --git a/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml index bbc2bb6849098..1953250d7b9bb 100644 --- a/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml +++ b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml @@ -1170,12 +1170,13 @@ components: description: The type of indicator. type: string example: sli.histogram.custom - timeslice_metric_basic_metric_with_field: - title: Timeslice Metric Basic Metric with Field + timeslice_metric_percentile_metric: + title: Timeslice Metric Percentile Metric required: - name - aggregation - field + - percentile type: object properties: name: @@ -1184,32 +1185,28 @@ components: example: A pattern: ^[A-Z]$ aggregation: - description: The aggregation type of the metric. + description: The aggregation type of the metric. Only valid option is "percentile" type: string - example: sum + example: percentile enum: - - sum - - avg - - min - - max - - std_deviation - - last_value - - cardinality + - percentile field: description: The field of the metric. type: string example: processor.processed + percentile: + description: The percentile value. + type: number + example: 95 filter: description: The filter to apply to the metric. type: string example: 'processor.outcome: "success"' - timeslice_metric_percentile_metric: - title: Timeslice Metric Percentile Metric + timeslice_metric_doc_count_metric: + title: Timeslice Metric Doc Count Metric required: - name - aggregation - - field - - percentile type: object properties: name: @@ -1218,28 +1215,21 @@ components: example: A pattern: ^[A-Z]$ aggregation: - description: The aggregation type of the metric. Only valid option is "percentile" + description: The aggregation type of the metric. Only valid option is "doc_count" type: string - example: percentile + example: doc_count enum: - - percentile - field: - description: The field of the metric. - type: string - example: processor.processed - percentile: - description: The percentile value. - type: number - example: 95 + - doc_count filter: description: The filter to apply to the metric. type: string example: 'processor.outcome: "success"' - timeslice_metric_doc_count_metric: - title: Timeslice Metric Doc Count Metric + timeslice_metric_basic_metric_with_field: + title: Timeslice Metric Basic Metric with Field required: - name - aggregation + - field type: object properties: name: @@ -1248,11 +1238,21 @@ components: example: A pattern: ^[A-Z]$ aggregation: - description: The aggregation type of the metric. Only valid option is "doc_count" + description: The aggregation type of the metric. type: string - example: doc_count + example: sum enum: - - doc_count + - sum + - avg + - min + - max + - std_deviation + - last_value + - cardinality + field: + description: The field of the metric. + type: string + example: processor.processed filter: description: The filter to apply to the metric. type: string @@ -1305,6 +1305,18 @@ components: description: List of metrics with their name, aggregation type, and field. type: array items: + discriminator: + propertyName: aggregation + mapping: + percentile: '#/components/schemas/timeslice_metric_percentile_metric' + doc_count: '#/components/schemas/timeslice_metric_doc_count_metric' + sum: '#/components/schemas/timeslice_metric_basic_metric_with_field' + avg: '#/components/schemas/timeslice_metric_basic_metric_with_field' + min: '#/components/schemas/timeslice_metric_basic_metric_with_field' + max: '#/components/schemas/timeslice_metric_basic_metric_with_field' + std_deviation: '#/components/schemas/timeslice_metric_basic_metric_with_field' + last_value: '#/components/schemas/timeslice_metric_basic_metric_with_field' + cardinality: '#/components/schemas/timeslice_metric_basic_metric_with_field' anyOf: - $ref: '#/components/schemas/timeslice_metric_basic_metric_with_field' - $ref: '#/components/schemas/timeslice_metric_percentile_metric' diff --git a/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_timeslice_metric.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_timeslice_metric.yaml index 8102ec0a312e6..3fa308322e702 100644 --- a/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_timeslice_metric.yaml +++ b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_timeslice_metric.yaml @@ -46,6 +46,18 @@ properties: description: List of metrics with their name, aggregation type, and field. type: array items: + discriminator: + propertyName: aggregation + mapping: + percentile: './timeslice_metric_percentile_metric.yaml' + doc_count: './timeslice_metric_doc_count_metric.yaml' + sum: './timeslice_metric_basic_metric_with_field.yaml' + avg: './timeslice_metric_basic_metric_with_field.yaml' + min: './timeslice_metric_basic_metric_with_field.yaml' + max: './timeslice_metric_basic_metric_with_field.yaml' + std_deviation: './timeslice_metric_basic_metric_with_field.yaml' + last_value: './timeslice_metric_basic_metric_with_field.yaml' + cardinality: './timeslice_metric_basic_metric_with_field.yaml' anyOf: - $ref: './timeslice_metric_basic_metric_with_field.yaml' - $ref: './timeslice_metric_percentile_metric.yaml'