Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8b32a1a
render sample metrics
rbrtj Apr 24, 2025
869980a
Merge remote-tracking branch 'upstream/main' into aiops-change-point-…
rbrtj May 8, 2025
ce55fa0
simplify use_change_point_agg_request && adjust variable name
rbrtj May 8, 2025
ca84073
update charts embeddable no change point warning
rbrtj May 8, 2025
bbbc455
do not prematurely stop fetching of change points
rbrtj May 9, 2025
5b0f3d0
Use reason for warning messages if possible
rbrtj May 19, 2025
5558ac3
Merge branch 'main' into aiops-change-point-enhance-no-results-state
rbrtj May 19, 2025
90b14b0
Display a warning for change point table embeddable
rbrtj May 19, 2025
523139c
add functional tests
rbrtj May 20, 2025
b74dde5
Merge branch 'main' into aiops-change-point-enhance-no-results-state
rbrtj May 20, 2025
408099b
Merge branch 'main' into aiops-change-point-enhance-no-results-state
rbrtj May 21, 2025
44f6327
use callout for warnings in embeddables
rbrtj May 21, 2025
213d64a
remove unused variable
rbrtj May 21, 2025
3231f92
remove empty line
rbrtj May 21, 2025
e7144fb
remove unused component
rbrtj May 21, 2025
812f366
adjust tests
rbrtj May 22, 2025
2e70ada
remove unused translations
rbrtj May 22, 2025
b400d26
Merge branch 'main' into aiops-change-point-enhance-no-results-state
rbrtj May 22, 2025
5ea0a4e
[CI] Auto-commit changed files from 'node scripts/lint_packages --fix'
kibanamachine May 22, 2025
f6915bc
Merge branch 'main' into aiops-change-point-enhance-no-results-state
rbrtj May 22, 2025
4d4acce
Merge branch 'main' into aiops-change-point-enhance-no-results-state
rbrtj May 26, 2025
3c0ee8b
extend error message
rbrtj May 27, 2025
124ad16
simplify change point results logic
rbrtj May 29, 2025
fe50c0c
remove unused property && add comment explaining sampleChangePointRes…
rbrtj May 29, 2025
20bf2de
Merge branch 'main' into aiops-change-point-enhance-no-results-state
rbrtj May 29, 2025
c4e7365
remove empty line
rbrtj May 29, 2025
e2b38f1
revert validChangePoints to results variable name
rbrtj May 29, 2025
ec39420
Merge branch 'main' into aiops-change-point-enhance-no-results-state
rbrtj Jun 2, 2025
46b2fdc
get rid of useAnnotations hook && consolidate logic in use_change_poi…
rbrtj Jun 2, 2025
7f9b09a
use FormattedMessage
rbrtj Jun 2, 2025
4d04d5c
check for undefined p_value
rbrtj Jun 2, 2025
c3a1736
remove unnecessary useMemo
rbrtj Jun 2, 2025
2e7a9ff
update no data found warning text
rbrtj Jun 2, 2025
File filter

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 @@ -10216,7 +10216,6 @@
"xpack.aiops.changePointDetection.maxSeriesToPlotLabel": "Série max.",
"xpack.aiops.changePointDetection.noChangePointsFoundMessage": "Détectez les points de modification statistiquement significatifs tels que les baisses, les pics et les modifications de distribution dans un indicateur. Sélectionnez un indicateur et définissez une plage temporelle pour commencer à détecter les points de modification dans vos données.",
"xpack.aiops.changePointDetection.noChangePointsFoundTitle": "Aucun point de modification trouvé",
"xpack.aiops.changePointDetection.notResultsWarning": "Avertissement de résultats agrégés d'absence de point de modification",
"xpack.aiops.changePointDetection.notSelectedSplitFieldLabel": "--- Non sélectionné ---",
"xpack.aiops.changePointDetection.objectTypeLabel": "Graphique de points de modification",
"xpack.aiops.changePointDetection.partitionsDescription": "Si aucune valeur n'est spécifiée, les principaux points de modifications parmi toutes les valeurs des champs divisés seront affichés.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10208,7 +10208,6 @@
"xpack.aiops.changePointDetection.maxSeriesToPlotLabel": "最大系列",
"xpack.aiops.changePointDetection.noChangePointsFoundMessage": "メトリックの急降下、急上昇、分布の変化などの統計的に有意な変化点を検出します。メトリックを選択し、時間範囲を選択して、データの変化点の検出を開始します。",
"xpack.aiops.changePointDetection.noChangePointsFoundTitle": "変化点が見つかりません",
"xpack.aiops.changePointDetection.notResultsWarning": "変化点の集約結果警告",
"xpack.aiops.changePointDetection.notSelectedSplitFieldLabel": "--- 未選択 ---",
"xpack.aiops.changePointDetection.objectTypeLabel": "変化点チャート",
"xpack.aiops.changePointDetection.partitionsDescription": "指定しない場合、すべての分割されたフィールド値で最も大きい変化点が表示されます。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10223,7 +10223,6 @@
"xpack.aiops.changePointDetection.maxSeriesToPlotLabel": "最大序列",
"xpack.aiops.changePointDetection.noChangePointsFoundMessage": "检测具有统计意义的更改点,如低谷、高峰,以及指标中的分布变化。选择指标并设置时间范围,以开始在您的数据中检测更改点。",
"xpack.aiops.changePointDetection.noChangePointsFoundTitle": "找不到更改点",
"xpack.aiops.changePointDetection.notResultsWarning": "无更改点聚���结果警告",
"xpack.aiops.changePointDetection.notSelectedSplitFieldLabel": "--- 未选择 ---",
"xpack.aiops.changePointDetection.objectTypeLabel": "更改点图表",
"xpack.aiops.changePointDetection.partitionsDescription": "如果未提供,将显示所有分割字段值中的最大更改点。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ export const ChangePointDetectionContext = createContext<{
export interface ChangePointAnnotation {
id: string;
label: string;
reason: string;
timestamp: string;
reason?: string;
timestamp?: string;
group?: {
name: string;
value: string;
};
type: ChangePointType;
p_value: number;
p_value?: number;
}

export type SelectedChangePoint = FieldConfig & ChangePointAnnotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
type ChangePointAnnotation,
} from './change_point_detection_context';
import { type ChartComponentProps } from './chart_component';
import { NoChangePointsWarning } from './no_change_points_warning';
import { NoDataFoundWarning } from './no_data_warning';
import { useCommonChartProps } from './use_common_chart_props';

export interface ChangePointsTableProps {
Expand Down Expand Up @@ -198,7 +198,8 @@ export const ChangePointsTable: FC<ChangePointsTableProps> = ({
),
sortable: true,
truncateText: false,
render: (pValue: ChangePointAnnotation['p_value']) => pValue.toPrecision(3),
render: (pValue: ChangePointAnnotation['p_value']) =>
pValue !== undefined ? pValue.toPrecision(3) : '-',
},
...(fieldConfig.splitField
? [
Expand Down Expand Up @@ -339,7 +340,7 @@ export const ChangePointsTable: FC<ChangePointsTableProps> = ({
}
/>
) : (
<NoChangePointsWarning />
<NoDataFoundWarning />
)
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiHorizontalRule,
EuiIcon,
EuiPagination,
EuiPanel,
EuiPagination,
EuiText,
EuiToolTip,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { useTimefilter } from '@kbn/ml-date-picker';
import { type RefreshInterval } from '@kbn/data-plugin/common';
Expand Down Expand Up @@ -90,22 +87,6 @@ export const ChartsGrid: FC<{
listItems={[{ title: v.group.name, description: v.group.value }]}
/>
) : null}

{v.reason ? (
<EuiToolTip position="top" content={v.reason}>
<EuiIcon
tabIndex={0}
color={'warning'}
type="warning"
title={i18n.translate(
'xpack.aiops.changePointDetection.notResultsWarning',
{
defaultMessage: 'No change point agg results warning',
}
)}
/>
</EuiToolTip>
) : null}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText color={'subdued'} size={'s'}>
Expand Down Expand Up @@ -135,6 +116,7 @@ export const ChartsGrid: FC<{
/>
</EuiFlexItem>
) : null}

<EuiFlexItem grow={false}>
<EuiBadge color="hollow">{v.type}</EuiBadge>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import { useSplitFieldCardinality } from './use_split_field_cardinality';
import { ViewTypeSelector } from './view_type_selector';
import { CASES_TOAST_MESSAGES_TITLES } from '../../cases/constants';
import { getDataviewReferences } from '../../embeddables/get_dataview_references';
import { NoChangePointsCallout } from './no_change_points_callout';

const selectControlCss = { width: '350px' };

Expand Down Expand Up @@ -213,9 +214,10 @@ const FieldPanel: FC<FieldPanelProps> = ({
const [dashboardAttachmentReady, setDashboardAttachmentReady] = useState<boolean>(false);

const {
results: annotations,
results,
isLoading: annotationsLoading,
progress,
isUsingSampleData,
} = useChangePointResults(fieldConfig, requestParams, combinedQuery, splitFieldCardinality);

const selectedPartitions = useMemo(() => {
Expand Down Expand Up @@ -597,9 +599,10 @@ const FieldPanel: FC<FieldPanelProps> = ({
{isExpanded ? (
<ChangePointResults
fieldConfig={fieldConfig}
isLoading={annotationsLoading}
annotations={annotations}
splitFieldCardinality={splitFieldCardinality}
isLoading={annotationsLoading}
results={results}
isUsingSampleData={isUsingSampleData}
onSelectionChange={onSelectionChange}
/>
) : null}
Expand Down Expand Up @@ -719,7 +722,8 @@ interface ChangePointResultsProps {
fieldConfig: FieldConfig;
splitFieldCardinality: number | null;
isLoading: boolean;
annotations: ChangePointAnnotation[];
results: ChangePointAnnotation[];
isUsingSampleData: boolean;
onSelectionChange: (update: SelectedChangePoint[]) => void;
}

Expand All @@ -730,8 +734,9 @@ export const ChangePointResults: FC<ChangePointResultsProps> = ({
fieldConfig,
splitFieldCardinality,
isLoading,
annotations,
results,
onSelectionChange,
isUsingSampleData,
}) => {
const cardinalityExceeded =
splitFieldCardinality && splitFieldCardinality > SPLIT_FIELD_CARDINALITY_LIMIT;
Expand Down Expand Up @@ -765,8 +770,15 @@ export const ChangePointResults: FC<ChangePointResultsProps> = ({
</>
) : null}

{isUsingSampleData && (
<>
<NoChangePointsCallout reason={results[0]?.reason} />
<EuiSpacer size="m" />
</>
)}

<ChangePointsTable
annotations={annotations}
annotations={results}
fieldConfig={fieldConfig}
isLoading={isLoading}
onSelectionChange={onSelectionChange}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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 from 'react';
import type { FC } from 'react';
import { EuiCallOut } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';

interface NoChangePointsCalloutProps {
reason?: string;
}

export const NoChangePointsCallout: FC<NoChangePointsCalloutProps> = ({ reason }) => {
return (
<EuiCallOut
data-test-subj="aiopsNoChangePointsWarningCallout"
title={
<FormattedMessage
id="xpack.aiops.changePointDetection.noChangePointsFoundTitle"
defaultMessage="No change points found"
/>
}
color="warning"
iconType="warning"
>
<p data-test-subj="aiopsNoChangePointsWarningCalloutText">
{reason ? (
<FormattedMessage
id="xpack.aiops.changePointDetection.reasonWithSampleMetricData"
defaultMessage="{reason} - showing sample metric data"
values={{ reason }}
/>
) : (
<FormattedMessage
id="xpack.aiops.changePointDetection.noChangePointsFoundMessage"
defaultMessage="No change points detected - showing sample metric data"
/>
)}
</p>
</EuiCallOut>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiEmptyPrompt } from '@elastic/eui';

export const NoChangePointsWarning = (props: { onRenderComplete?: () => void }) => {
export const NoDataFoundWarning = (props: { onRenderComplete?: () => void }) => {
props.onRenderComplete?.();

return (
<EuiEmptyPrompt
data-test-subj="aiopsNoDataFoundWarning"
iconType="search"
title={
<h2>
<FormattedMessage
id="xpack.aiops.changePointDetection.noChangePointsFoundTitle"
defaultMessage="No change points found"
id="xpack.aiops.changePointDetection.noDataFoundTitle"
defaultMessage="No data found"
/>
</h2>
}
body={
<p>
<FormattedMessage
id="xpack.aiops.changePointDetection.noChangePointsFoundMessage"
defaultMessage="Detect statistically significant change points such as dips, spikes, and distribution changes in a metric. Select a metric and set a time range to start detecting change points in your data."
id="xpack.aiops.changePointDetection.noDataFoundMessage"
defaultMessage="No data found for the selected metric and time range. Try adjusting your selection to include data from your indices."
/>
</p>
}
Expand Down
Loading