feat(slo): group by slo id (#210469)

This commit is contained in:
Kevin Delemme 2025-02-11 07:55:41 -05:00 committed by GitHub
parent d36df89025
commit 9545d6b127
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 17 additions and 1 deletions

View file

@ -14,6 +14,7 @@ const groupBySchema = t.union([
t.literal('slo.indicator.type'),
t.literal('slo.instanceId'),
t.literal('_index'),
t.literal('slo.id'),
]);
const findSLOGroupsParamsSchema = t.partial({

View file

@ -59,6 +59,9 @@ export function QuickFilters({
align-items: flex-start;
min-height: initial;
}
.controlPanel {
height: initial;
}
.controlGroup {
min-height: initial;
}

View file

@ -18,6 +18,7 @@ export function useGroupName(groupBy: GroupByField, group: string, summary?: Gro
case 'ungrouped':
case 'slo.tags':
case 'status':
case 'slo.id':
return groupName;
case 'slo.instanceId':
if (groupName === ALL_VALUE || !summary?.worst?.slo?.groupings) {

View file

@ -80,6 +80,16 @@ export function SloGroupBy({ onStateChange, state, loading }: Props) {
handleChangeGroupBy('slo.indicator.type');
},
},
{
label: i18n.translate('xpack.slo.list.groupBy.sloId', {
defaultMessage: 'SLO definition id',
}),
checked: groupBy === 'slo.id',
value: 'slo.id',
onClick: () => {
handleChangeGroupBy('slo.id');
},
},
{
label: i18n.translate('xpack.slo.list.groupBy.sloInstanceId', {
defaultMessage: 'SLO instance id',

View file

@ -12,7 +12,8 @@ export type GroupByField =
| 'status'
| 'slo.indicator.type'
| 'slo.instanceId'
| '_index';
| '_index'
| 'slo.id';
export type SortDirection = 'asc' | 'desc';
export type SortField =
| 'sli_value'