Skip to content

Commit 5329a77

Browse files
[SLO] Add Health Column to SLO Management Table (#239632)
Closes #238134 ## Summary This PR adds a new health column to the SLO management table. Filtering and sorting will be handled in a future PR. The statuses of this column include **Healthy** and **Needs attention** I've also updated the statuses of the existing state column to: - Enabled (replaces running) - Disabled (replaces paused) ## Before <img width="836" height="690" alt="Screenshot 2025-10-17 at 5 05 50 PM" src="https://github.com/user-attachments/assets/a43d06a8-79a4-43d9-b877-ca7e8ee7c127" /> ## After https://github.com/user-attachments/assets/5533b792-ea02-4e38-8036-abc4851a21fc ## Testing To get the "Needs attention" label, you may delete a transform that belongs to an SLO or stop a transform on an enabled SLO. --------- Co-authored-by: kibanamachine <[email protected]>
1 parent 1862606 commit 5329a77

File tree

20 files changed

+593
-91
lines changed

20 files changed

+593
-91
lines changed

oas_docs/output/kibana.serverless.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65952,11 +65952,16 @@ paths:
6595265952
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
6595365953
- $ref: '#/components/parameters/SLOs_space_id'
6595465954
- description: Indicates if the API returns only outdated SLO or all SLO definitions
65955-
example: true
6595665955
in: query
6595765956
name: includeOutdatedOnly
6595865957
schema:
6595965958
type: boolean
65959+
- description: Indicates if the API returns SLO health data with definitions
65960+
example: true
65961+
in: query
65962+
name: includeHealth
65963+
schema:
65964+
type: boolean
6596065965
- description: Filters the SLOs by tag
6596165966
in: query
6596265967
name: tags
@@ -84000,6 +84005,22 @@ components:
8400084005
- statusCode
8400184006
- error
8400284007
- message
84008+
SLOs_artifacts:
84009+
description: Links to related assets for the SLO
84010+
properties:
84011+
dashboards:
84012+
description: Array of dashboard references
84013+
items:
84014+
type: object
84015+
properties:
84016+
id:
84017+
description: Dashboard saved-object id
84018+
type: string
84019+
required:
84020+
- id
84021+
type: array
84022+
title: Artifacts
84023+
type: object
8400384024
SLOs_budgeting_method:
8400484025
description: The budgeting method to use when computing the rollup data.
8400584026
enum:
@@ -84120,6 +84141,8 @@ components:
8412084141
description: |
8412184142
The create SLO API request body varies depending on the type of indicator, time window and budgeting method.
8412284143
properties:
84144+
artifacts:
84145+
$ref: '#/components/schemas/SLOs_artifacts'
8412384146
budgetingMethod:
8412484147
$ref: '#/components/schemas/SLOs_budgeting_method'
8412584148
description:
@@ -84934,6 +84957,8 @@ components:
8493484957
title: SLO definition response
8493584958
type: object
8493684959
properties:
84960+
artifacts:
84961+
$ref: '#/components/schemas/SLOs_artifacts'
8493784962
budgetingMethod:
8493884963
$ref: '#/components/schemas/SLOs_budgeting_method'
8493984964
createdAt:
@@ -85241,6 +85266,8 @@ components:
8524185266
description: |
8524285267
The update SLO API request body varies depending on the type of indicator, time window and budgeting method. Partial update is handled.
8524385268
properties:
85269+
artifacts:
85270+
$ref: '#/components/schemas/SLOs_artifacts'
8524485271
budgetingMethod:
8524585272
$ref: '#/components/schemas/SLOs_budgeting_method'
8524685273
description:

oas_docs/output/kibana.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74487,11 +74487,16 @@ paths:
7448774487
- $ref: '#/components/parameters/SLOs_kbn_xsrf'
7448874488
- $ref: '#/components/parameters/SLOs_space_id'
7448974489
- description: Indicates if the API returns only outdated SLO or all SLO definitions
74490-
example: true
7449174490
in: query
7449274491
name: includeOutdatedOnly
7449374492
schema:
7449474493
type: boolean
74494+
- description: Indicates if the API returns SLO health data with definitions
74495+
example: true
74496+
in: query
74497+
name: includeHealth
74498+
schema:
74499+
type: boolean
7449574500
- description: Filters the SLOs by tag
7449674501
in: query
7449774502
name: tags
@@ -97408,6 +97413,22 @@ components:
9740897413
- statusCode
9740997414
- error
9741097415
- message
97416+
SLOs_artifacts:
97417+
description: Links to related assets for the SLO
97418+
properties:
97419+
dashboards:
97420+
description: Array of dashboard references
97421+
items:
97422+
type: object
97423+
properties:
97424+
id:
97425+
description: Dashboard saved-object id
97426+
type: string
97427+
required:
97428+
- id
97429+
type: array
97430+
title: Artifacts
97431+
type: object
9741197432
SLOs_budgeting_method:
9741297433
description: The budgeting method to use when computing the rollup data.
9741397434
enum:
@@ -97528,6 +97549,8 @@ components:
9752897549
description: |
9752997550
The create SLO API request body varies depending on the type of indicator, time window and budgeting method.
9753097551
properties:
97552+
artifacts:
97553+
$ref: '#/components/schemas/SLOs_artifacts'
9753197554
budgetingMethod:
9753297555
$ref: '#/components/schemas/SLOs_budgeting_method'
9753397556
description:
@@ -98342,6 +98365,8 @@ components:
9834298365
title: SLO definition response
9834398366
type: object
9834498367
properties:
98368+
artifacts:
98369+
$ref: '#/components/schemas/SLOs_artifacts'
9834598370
budgetingMethod:
9834698371
$ref: '#/components/schemas/SLOs_budgeting_method'
9834798372
createdAt:
@@ -98649,6 +98674,8 @@ components:
9864998674
description: |
9865098675
The update SLO API request body varies depending on the type of indicator, time window and budgeting method. Partial update is handled.
9865198676
properties:
98677+
artifacts:
98678+
$ref: '#/components/schemas/SLOs_artifacts'
9865298679
budgetingMethod:
9865398680
$ref: '#/components/schemas/SLOs_budgeting_method'
9865498681
description:

x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
*/
77
import { toBooleanRt } from '@kbn/io-ts-utils/src/to_boolean_rt';
88
import * as t from 'io-ts';
9-
import { sloDefinitionSchema } from '../../schema';
9+
import { sloDefinitionAndHealthSchema, sloDefinitionSchema } from '../../schema';
1010

1111
const findSloDefinitionsParamsSchema = t.partial({
1212
query: t.partial({
1313
search: t.string,
1414
includeOutdatedOnly: toBooleanRt,
15+
includeHealth: toBooleanRt,
1516
tags: t.string,
1617
page: t.string,
1718
perPage: t.string,
@@ -25,8 +26,26 @@ const findSloDefinitionsResponseSchema = t.type({
2526
results: t.array(sloDefinitionSchema),
2627
});
2728

29+
const findSloDefinitionsWithHealthResponseSchema = t.type({
30+
page: t.number,
31+
perPage: t.number,
32+
total: t.number,
33+
results: t.array(sloDefinitionAndHealthSchema),
34+
});
35+
2836
type FindSLODefinitionsParams = t.TypeOf<typeof findSloDefinitionsParamsSchema.props.query>;
2937
type FindSLODefinitionsResponse = t.OutputOf<typeof findSloDefinitionsResponseSchema>;
38+
type FindSLODefinitionsWithHealthResponse = t.OutputOf<
39+
typeof findSloDefinitionsWithHealthResponseSchema
40+
>;
3041

31-
export { findSloDefinitionsParamsSchema, findSloDefinitionsResponseSchema };
32-
export type { FindSLODefinitionsParams, FindSLODefinitionsResponse };
42+
export {
43+
findSloDefinitionsParamsSchema,
44+
findSloDefinitionsResponseSchema,
45+
findSloDefinitionsWithHealthResponseSchema,
46+
};
47+
export type {
48+
FindSLODefinitionsParams,
49+
FindSLODefinitionsResponse,
50+
FindSLODefinitionsWithHealthResponse,
51+
};

x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77
import * as t from 'io-ts';
8-
import { healthStatusSchema, sloIdSchema, stateSchema } from '../../schema';
8+
import { healthStatusSchema, sloIdSchema, stateSchema, transformHealthSchema } from '../../schema';
99
import { allOrAnyString } from '../../schema/common';
1010

1111
const fetchSLOHealthDataSchema = t.array(
@@ -15,7 +15,7 @@ const fetchSLOHealthDataSchema = t.array(
1515
sloName: t.string,
1616
state: stateSchema,
1717
health: t.type({
18-
overall: healthStatusSchema,
18+
overall: transformHealthSchema,
1919
rollup: healthStatusSchema,
2020
summary: healthStatusSchema,
2121
}),

x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
metaSchema,
1313
remoteSchema,
1414
sloDefinitionSchema,
15+
type sloDefinitionAndHealthSchema,
1516
summarySchema,
1617
} from '../schema';
1718

@@ -25,7 +26,8 @@ const sloWithDataResponseSchema = t.intersection([
2526
]);
2627

2728
type SLODefinitionResponse = t.OutputOf<typeof sloDefinitionSchema>;
29+
type SLODefinitionWithHealthResponse = t.OutputOf<typeof sloDefinitionAndHealthSchema>;
2830
type SLOWithSummaryResponse = t.OutputOf<typeof sloWithDataResponseSchema>;
2931

3032
export { sloWithDataResponseSchema };
31-
export type { SLODefinitionResponse, SLOWithSummaryResponse };
33+
export type { SLODefinitionResponse, SLODefinitionWithHealthResponse, SLOWithSummaryResponse };

x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,26 @@
77

88
import * as t from 'io-ts';
99

10-
const healthStatusSchema = t.union([
10+
const transformHealthSchema = t.union([
1111
t.literal('healthy'),
1212
t.literal('unhealthy'),
1313
t.literal('missing'),
1414
]);
15+
16+
const healthStatusSchema = t.intersection([
17+
t.partial({
18+
transformState: t.union([t.literal('stopped'), t.literal('started')]),
19+
}),
20+
t.type({
21+
status: transformHealthSchema,
22+
}),
23+
]);
24+
1525
const stateSchema = t.union([
1626
t.literal('no_data'),
1727
t.literal('indexing'),
1828
t.literal('running'),
1929
t.literal('stale'),
2030
]);
2131

22-
export { healthStatusSchema, stateSchema };
32+
export { transformHealthSchema, healthStatusSchema, stateSchema };

x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { allOrAnyStringOrArray, dateType } from './common';
1111
import { durationType } from './duration';
1212
import { indicatorSchema } from './indicators';
1313
import { timeWindowSchema } from './time_window';
14+
import { healthStatusSchema, stateSchema, transformHealthSchema } from './health';
1415

1516
const occurrencesBudgetingMethodSchema = t.literal('occurrences');
1617
const timeslicesBudgetingMethodSchema = t.literal('timeslices');
@@ -110,6 +111,19 @@ const artifactsWithRefIdSchema = t.partial({ artifacts: dashboardsWithRefIdSchem
110111

111112
const sloDefinitionSchema = t.intersection([baseSloSchema, artifactsWithIdSchema]);
112113

114+
const sloDefinitionAndHealthSchema = t.intersection([
115+
baseSloSchema,
116+
artifactsWithIdSchema,
117+
t.partial({
118+
state: stateSchema,
119+
health: t.type({
120+
overall: transformHealthSchema,
121+
rollup: healthStatusSchema,
122+
summary: healthStatusSchema,
123+
}),
124+
}),
125+
]);
126+
113127
const storedSloDefinitionSchema = t.intersection([baseSloSchema, artifactsWithRefIdSchema]);
114128

115129
export {
@@ -120,6 +134,7 @@ export {
120134
optionalSettingsSchema,
121135
settingsSchema,
122136
sloDefinitionSchema,
137+
sloDefinitionAndHealthSchema,
123138
storedSloDefinitionSchema,
124139
sloIdSchema,
125140
tagsSchema,

x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,14 @@
787787
"name": "includeOutdatedOnly",
788788
"in": "query",
789789
"description": "Indicates if the API returns only outdated SLO or all SLO definitions",
790+
"schema": {
791+
"type": "boolean"
792+
}
793+
},
794+
{
795+
"name": "includeHealth",
796+
"in": "query",
797+
"description": "Indicates if the API returns SLO health data with definitions",
790798
"schema": {
791799
"type": "boolean"
792800
},
@@ -2430,6 +2438,29 @@
24302438
}
24312439
}
24322440
},
2441+
"artifacts": {
2442+
"title": "Artifacts",
2443+
"description": "Links to related assets for the SLO",
2444+
"type": "object",
2445+
"properties": {
2446+
"dashboards": {
2447+
"description": "Array of dashboard references",
2448+
"type": "array",
2449+
"items": {
2450+
"type": "object",
2451+
"required": [
2452+
"id"
2453+
],
2454+
"properties": {
2455+
"id": {
2456+
"description": "Dashboard saved-object id",
2457+
"type": "string"
2458+
}
2459+
}
2460+
}
2461+
}
2462+
}
2463+
},
24332464
"create_slo_request": {
24342465
"title": "Create SLO request",
24352466
"description": "The create SLO API request body varies depending on the type of indicator, time window and budgeting method.\n",
@@ -2499,6 +2530,9 @@
24992530
"items": {
25002531
"type": "string"
25012532
}
2533+
},
2534+
"artifacts": {
2535+
"$ref": "#/components/schemas/artifacts"
25022536
}
25032537
}
25042538
},
@@ -2594,6 +2628,9 @@
25942628
"items": {
25952629
"type": "string"
25962630
}
2631+
},
2632+
"artifacts": {
2633+
"$ref": "#/components/schemas/artifacts"
25972634
}
25982635
}
25992636
},
@@ -2698,6 +2735,9 @@
26982735
"type": "string"
26992736
}
27002737
},
2738+
"artifacts": {
2739+
"$ref": "#/components/schemas/artifacts"
2740+
},
27012741
"createdAt": {
27022742
"description": "The creation date",
27032743
"type": "string",

0 commit comments

Comments
 (0)