Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
bee87f8
select slo id first and then specific instances
mgiota Dec 5, 2025
56a93af
fix clear issue
mgiota Dec 5, 2025
4cf533f
remove initial input (edit configuration is not enabled)
mgiota Jan 2, 2026
52ed5b3
fix remote type issue
mgiota Jan 2, 2026
5a4bc4f
disable save button if no instanceId is selected
mgiota Jan 2, 2026
6afe593
remove leftovers
mgiota Jan 2, 2026
f2bebf0
remove unused initialInstanceId
mgiota Jan 2, 2026
e7bd885
cleanup
mgiota Jan 2, 2026
c77f3ac
Merge branch 'main' into slo-overview-embeddable-instances-api
elasticmachine Jan 5, 2026
9bec6e0
Merge branch 'main' into slo-overview-embeddable-instances-api
kdelemme Jan 5, 2026
db05036
DRAFT WIP
mgiota Jan 7, 2026
45c7307
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 8, 2026
06621cb
Merge branch 'main' of github.com:elastic/kibana into slo-overview-em…
mgiota Jan 16, 2026
39e7089
display remote instances in the instances dropdown
mgiota Jan 16, 2026
4f2cc79
Merge branch 'main' into slo-overview-embeddable-instances-api
elasticmachine Jan 19, 2026
7e88050
update esquery, use simple_query_string, add runtime_mappings
mgiota Jan 19, 2026
4d8e281
read remoteName from fields
mgiota Jan 19, 2026
1375638
fix eslint issues
mgiota Jan 19, 2026
d2495f7
more eslint fixes
mgiota Jan 19, 2026
045985c
fix local group by slos
mgiota Jan 19, 2026
8ab4d39
Update x-pack/solutions/observability/plugins/slo/public/embeddable/s…
mgiota Jan 19, 2026
1ec76a6
Update x-pack/solutions/observability/plugins/slo/public/embeddable/s…
mgiota Jan 19, 2026
9efc681
fix type issues
mgiota Jan 19, 2026
5173b71
add component tests for slo instance selector
mgiota Jan 19, 2026
7e8a496
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 19, 2026
b4efe1d
cleanup
mgiota Jan 19, 2026
74070ec
use group by
mgiota Jan 19, 2026
67dd0d2
fix eslint issues
mgiota Jan 19, 2026
9d6bd34
fix type issues on test file
mgiota Jan 19, 2026
13c0f04
cleanup
mgiota Jan 19, 2026
fec5a33
remove commented code
mgiota Jan 19, 2026
0672e19
fix failing functional tests
mgiota Jan 20, 2026
532d2f5
fix failing functional tests
mgiota Jan 20, 2026
dc045ac
proper use of runtime field for remoteName
mgiota Jan 20, 2026
c4e2792
remove unused searchAfter
mgiota Jan 20, 2026
a46a221
remove show all instances toggle in favor of all instances combobox o…
mgiota Jan 20, 2026
7c4ec70
fix type issue
mgiota Jan 20, 2026
7de73cc
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 20, 2026
98602a6
clean up
mgiota Jan 20, 2026
24141f2
remove useMemo
mgiota Jan 20, 2026
226cf6a
refactor searchSLODefinitionsParamsSchema
mgiota Jan 20, 2026
9c835df
remove unnecessary duplicate code
mgiota Jan 20, 2026
6ca95ce
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 20, 2026
0e20edd
fix failing tests
mgiota Jan 20, 2026
ad8bc67
add unit tests for search_slo_definition service
mgiota Jan 20, 2026
95eeda8
deployment agnostic api tests for the new search slo definition api
mgiota Jan 20, 2026
a2c6151
fix failing unit tests
mgiota Jan 20, 2026
062914c
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 20, 2026
861a8ac
fix type issues
mgiota Jan 20, 2026
903d878
remove unit test, code was removed in another commit
mgiota Jan 21, 2026
c2c788b
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 21, 2026
0d1e7f8
remove unused code
mgiota Jan 21, 2026
7cd1e19
refactor types
mgiota Jan 21, 2026
cae8db4
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 21, 2026
a2f3ba1
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 21, 2026
19a1631
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 22, 2026
b4ee543
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 22, 2026
7d941d4
Merge branch 'main' of github.com:elastic/kibana into slo-overview-em…
mgiota Jan 26, 2026
a2aa6fc
fix failing unit test
mgiota Jan 26, 2026
98d869f
Merge branch 'main' into slo-overview-embeddable-instances-api
mgiota Jan 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ export * from './bulk_delete';
export * from './find_instances';
export * from './repair';
export * from './slo_templates';
export * from './search_slo_definitions';
export * from './get_grouped_stats';
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import * as t from 'io-ts';
import { toNumberRt } from '@kbn/io-ts-utils';

const searchSLODefinitionsParamsSchema = t.partial({
query: t.partial({
search: t.string,
size: toNumberRt,
searchAfter: t.string,
remoteName: t.string,
}),
});

type SearchSLODefinitionsParams = t.TypeOf<typeof searchSLODefinitionsParamsSchema.props.query>;

interface SearchSLODefinitionItem {
id: string;
name: string;
groupBy: string[];
remote?: { remoteName: string; kibanaUrl: string };
}

interface SearchSLODefinitionResponse {
results: SearchSLODefinitionItem[];
searchAfter?: string;
}

export { searchSLODefinitionsParamsSchema };
export type { SearchSLODefinitionsParams, SearchSLODefinitionResponse, SearchSLODefinitionItem };
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiSwitch,
EuiSpacer,
EuiFlyout,
EuiFlyoutHeader,
Expand All @@ -23,7 +22,9 @@ import {
import { FormattedMessage } from '@kbn/i18n-react';
import { ALL_VALUE } from '@kbn/slo-schema';
import { i18n } from '@kbn/i18n';
import { SloSelector } from '../alerts/slo_selector';
import type { SearchSLODefinitionItem } from '@kbn/slo-schema';
import { SloDefinitionSelector } from './slo_definition_selector';
import { SloInstanceSelector } from './slo_instance_selector';

import type {
SingleSloCustomInput,
Expand Down Expand Up @@ -54,60 +55,65 @@ interface GroupConfigurationProps {
}

function SingleSloConfiguration({ overviewMode, onCreate, onCancel }: SingleConfigurationProps) {
const [selectedSlo, setSelectedSlo] = useState<SingleSloCustomInput>();
const [showAllGroupByInstances, setShowAllGroupByInstances] = useState(false);
const [selectedSloDefinition, setSelectedSloDefinition] = useState<
SearchSLODefinitionItem | undefined
>();
const [selectedInstanceId, setSelectedInstanceId] = useState<string | undefined>(ALL_VALUE);
const [hasError, setHasError] = useState(false);
const hasGroupBy = selectedSlo && selectedSlo.sloInstanceId !== ALL_VALUE;
const showAllGroupByInstances = selectedInstanceId === ALL_VALUE;

const hasGroupBy = selectedSloDefinition?.groupBy
? selectedSloDefinition.groupBy.length > 0 && !selectedSloDefinition.groupBy.includes(ALL_VALUE)
: false;

const onConfirmClick = () => {
if (!selectedSloDefinition) {
setHasError(true);
return;
}

const remoteName: string | undefined = selectedSloDefinition?.remote?.remoteName;

const onConfirmClick = () =>
onCreate({
showAllGroupByInstances,
sloId: selectedSlo?.sloId,
sloInstanceId: selectedSlo?.sloInstanceId,
remoteName: selectedSlo?.remoteName,
sloId: selectedSloDefinition.id,
sloInstanceId: selectedInstanceId ?? ALL_VALUE,
remoteName,
overviewMode,
});
};

return (
<>
<EuiFlyoutBody>
<EuiFlexGroup>
<EuiFlexItem>
<EuiFlexGroup>
<EuiFlexGroup direction="column" gutterSize="m">
<EuiFlexItem data-test-subj="singleSloSelector" grow>
<SloSelector
singleSelection={true}
hasError={hasError}
<SloDefinitionSelector
hasError={hasError && !selectedSloDefinition}
onSelected={(slo) => {
setSelectedSloDefinition(slo);
setHasError(slo === undefined);
if (slo && 'id' in slo) {
setSelectedSlo({
sloId: slo.id,
sloInstanceId: slo.instanceId,
remoteName: slo.remote?.remoteName,
});
// Reset instance selection when SLO changes
if (slo) {
setSelectedInstanceId(undefined);
}
}}
/>
</EuiFlexItem>
{hasGroupBy && selectedSloDefinition && (
<EuiFlexItem data-test-subj="singleSloInstanceSelector" grow>
<SloInstanceSelector
remoteName={selectedSloDefinition.remote?.remoteName}
sloId={selectedSloDefinition.id}
onSelected={(instanceId) => {
setSelectedInstanceId(instanceId);
}}
/>
</EuiFlexItem>
)}
</EuiFlexGroup>
{hasGroupBy && (
<>
<EuiSpacer />
<EuiSwitch
label={i18n.translate(
'xpack.slo.sloConfiguration.euiSwitch.showAllGroupByLabel',
{
defaultMessage: 'Show all related group-by instances',
}
)}
checked={showAllGroupByInstances}
onChange={(e) => {
setShowAllGroupByInstances(e.target.checked);
}}
/>
</>
)}
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlyoutBody>
Expand All @@ -122,7 +128,7 @@ function SingleSloConfiguration({ overviewMode, onCreate, onCancel }: SingleConf

<EuiButton
data-test-subj="sloConfirmButton"
isDisabled={!selectedSlo || hasError}
isDisabled={!selectedSloDefinition || hasError || (hasGroupBy && !selectedInstanceId)}
onClick={onConfirmClick}
fill
>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React, { useMemo, useEffect, useState } from 'react';
import type { EuiComboBoxOptionOption } from '@elastic/eui';
import { EuiComboBox, EuiFormRow } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { debounce } from 'lodash';
import type { SearchSLODefinitionItem } from '@kbn/slo-schema';
import { useFetchSloDefinitionsWithRemote } from '../../../hooks/use_fetch_slo_definitions_with_remote';

interface Props {
onSelected: (slo: SearchSLODefinitionItem | undefined) => void;
hasError?: boolean;
remoteName?: string;
}

const SLO_REQUIRED = i18n.translate('xpack.slo.sloEmbeddable.config.errors.sloRequired', {
defaultMessage: 'SLO is required.',
});

export function SloDefinitionSelector({ onSelected, hasError, remoteName }: Props) {
const [selectedOptions, setSelectedOptions] = useState<Array<EuiComboBoxOptionOption<string>>>(
[]
);
const [searchValue, setSearchValue] = useState<string>('');
const search = searchValue.trim();

const { isLoading, data: definitionsData } = useFetchSloDefinitionsWithRemote({
search,
size: 100,
remoteName,
});

const options = useMemo(() => {
return (
definitionsData?.results.map((slo) => ({
label: slo.name,
value: slo.id,
})) ?? []
);
}, [definitionsData]);

const onChange = (opts: Array<EuiComboBoxOptionOption<string>>) => {
setSelectedOptions(opts);
if (opts.length === 0) {
onSelected(undefined);
return;
}

const selectedSloId = opts[0].value!;
const selectedSlo = definitionsData?.results.find((slo) => slo.id === selectedSloId);
onSelected(selectedSlo);
};

const onSearchChange = useMemo(
() =>
debounce((value: string) => {
setSearchValue(value);
}, 300),
[]
);

useEffect(() => {
return () => {
onSearchChange.cancel();
};
}, [onSearchChange]);

return (
<EuiFormRow
fullWidth
isInvalid={hasError}
error={hasError ? SLO_REQUIRED : undefined}
label={i18n.translate('xpack.slo.embeddable.sloDefinitionSelectorLabel', {
defaultMessage: 'SLO Definition',
})}
>
<EuiComboBox
aria-label={i18n.translate(
'xpack.slo.sloEmbeddable.config.sloDefinitionSelector.ariaLabel',
{
defaultMessage: 'SLO Definition',
}
)}
placeholder={i18n.translate(
'xpack.slo.sloEmbeddable.config.sloDefinitionSelector.placeholder',
{
defaultMessage: 'Select a SLO definition',
}
)}
data-test-subj="sloDefinitionSelector"
options={options}
selectedOptions={selectedOptions}
async
isLoading={isLoading}
onChange={onChange}
fullWidth
onSearchChange={onSearchChange}
isInvalid={hasError}
singleSelection={{ asPlainText: true }}
/>
</EuiFormRow>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ export const getOverviewEmbeddableFactory = ({
};

const queryClient = new QueryClient();

return (
<EuiThemeProvider darkMode={true}>
<KibanaContextProvider services={deps}>
Expand All @@ -249,7 +248,19 @@ export const getOverviewEmbeddableFactory = ({
}}
>
<QueryClientProvider client={queryClient}>
{showAllGroupByInstances ? <SloCardChartList sloId={sloId!} /> : renderOverview()}
{overviewMode === 'groups' ? (
renderOverview()
) : showAllGroupByInstances ? (
<div
data-test-subj="sloSingleOverviewPanel"
data-shared-item=""
style={{ width: '100%' }}
>
<SloCardChartList data-test-subj="sloSingleOverviewPanel" sloId={sloId!} />
</div>
) : (
renderOverview()
)}
</QueryClientProvider>
</PluginContext.Provider>
</KibanaContextProvider>
Expand Down
Loading
Loading