Skip to content

[ML] AIOps: Enhances No Results state for Change Point Detection#219072

Merged
rbrtj merged 33 commits intoelastic:mainfrom
rbrtj:aiops-change-point-enhance-no-results-state
Jun 2, 2025
Merged

[ML] AIOps: Enhances No Results state for Change Point Detection#219072
rbrtj merged 33 commits intoelastic:mainfrom
rbrtj:aiops-change-point-enhance-no-results-state

Conversation

@rbrtj
Copy link
Copy Markdown
Contributor

@rbrtj rbrtj commented Apr 24, 2025

This PR introduces new 'empty' states for Change Point Detection page and embeddable.
Previously, if no change point was found, we displayed an Empty State screen. Now, we plot a sample metric instead. For partitioned fields, we select the first partition value and plot a metric for it. If there is no data to plot for the selected time range, this PR introduces a new empty state screen.

Note: Warnings in the embeddable will be displayed in the bottom-left corner, similar to how Lens embeddable warnings are shown. Currently, we are waiting for the ability to push custom errors to the lens embeddable - see #220208

  • Embeddable (charts): No change point found, with a reason
image
  • Embeddable (charts): No change point found, without a reason
image
  • Embeddable (table): No change point found, with a reason
image
  • Embeddable (table): No change point found, without a reason
image
  • Change Point Page: No change point found, with a reason
image
  • Change Point Page: No change point found, without a reason
image

Fixes #170388

@rbrtj rbrtj changed the title render sample metrics Apr 24, 2025
@rbrtj rbrtj changed the title [ML] AiOps: Enhance No Results state Apr 24, 2025
@rbrtj rbrtj marked this pull request as ready for review May 20, 2025 13:29
@rbrtj rbrtj requested a review from a team as a code owner May 20, 2025 13:29
@rbrtj rbrtj self-assigned this May 20, 2025
@rbrtj rbrtj added release_note:enhancement :ml Team:ML Team label for ML (also use :ml) t// Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis backport:version Backport to applied version labels v9.1.0 v8.19.0 labels May 20, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@rbrtj rbrtj requested a review from peteharverson May 20, 2025 13:30
@peteharverson peteharverson changed the title [ML] AiOps: Enhance No Results state for Change Point Detection May 21, 2025
Copy link
Copy Markdown
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is working well. I like the callout in the ML page - can you see how it looks when used in the embeddable as I think it's a clearer UX than the warning icon? It will take up more space, but as we are only showing one series in this case, there is probably enough room.

@rbrtj rbrtj requested review from darnautov and peteharverson May 27, 2025 07:06
Copy link
Copy Markdown
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested latest changes and LGTM

Comment on lines +296 to +304
return [
{
...firstRawChangePoint.current,
kind: 'noChangePoints',
label: 'No change points found',
p_value: null,
timestamp: null,
},
];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simply return an empty array here instead? And get rid of the additional type with kind: 'noChangePoints ?
It should simplify the code quite a bit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified a bit in 124ad16


const [results, setResults] = useState<ChangePointAnnotation[]>([]);
const [validChangePoints, setValidChangePoints] = useState<ChangePointAnnotation[]>([]);
const firstRawChangePoint = useRef<ChangePointAnnotation | null>(null);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding a comment to explain why this is needed. Also, should we rename it to something more semantic, like sampleChangePointResponse?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 124ad16 and fe50c0c

@rbrtj rbrtj requested a review from darnautov May 29, 2025 08:35
results,
isLoading: annotationsLoading,
progress,
sampleChangePointResponse,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to return it from useChangePointResults and pass around

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 46b2fdc

@rbrtj rbrtj requested a review from darnautov June 2, 2025 08:32
Copy link
Copy Markdown
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, great enhancement! 🚀 Please update the functional tests using the UTC timezone.

Comment on lines +52 to +55
await PageObjects.timePicker.setAbsoluteRange(
'Jun 12, 2023 @ 00:04:19.000',
'Jun 12, 2023 @ 01:00:19.000'
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ There are potential issues with using absolute times in functional tests—time in CI can differ from your local environment. Consider setting the timezone in the before hook.

      await kibanaServer.uiSettings.update({
        'dateFormat:tz': 'UTC',
      });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the mentioned tests use await ml.testResources.setKibanaTimeZoneToUTC(); in the before hook, which is responsible for setting timezone to UTC

Comment thread x-pack/test/functional/apps/aiops/change_point_detection_cases.ts
Copy link
Copy Markdown
Contributor

@szabosteve szabosteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a small suggestion, otherwise LGTM.
cc @nastasha-solomon

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 was found for the selected metric and time range. Please adjust your selection to include data from your indices."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaultMessage="No data was found for the selected metric and time range. Please adjust your selection to include data from your indices."
defaultMessage="No data found for the selected metric and time range. Try adjusting your selection to include data from your indices."
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated - 2e7a9ff
Thanks!

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 608 609 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 505.1KB 506.3KB +1.2KB

History

cc @rbrtj

@rbrtj rbrtj merged commit 1e7d418 into elastic:main Jun 2, 2025
10 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15395864297

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 2, 2025
…astic#219072)

This PR introduces new 'empty' states for Change Point Detection page
and embeddable.
Previously, if no change point was found, we displayed an Empty State
screen. Now, we plot a sample metric instead. For partitioned fields, we
select the first partition value and plot a metric for it. If there is
no data to plot for the selected time range, this PR introduces a new
empty state screen.

Note: Warnings in the embeddable will be displayed in the bottom-left
corner, similar to how Lens embeddable warnings are shown. Currently, we
are waiting for the ability to push custom errors to the lens embeddable
- see elastic#220208

* Embeddable (charts): No change point found, with a reason
<img width="966" alt="image"
src="https://github.com/user-attachments/assets/88d4f920-6739-4af7-9903-1fb210dfa089"
/>

* Embeddable (charts): No change point found, without a reason
<img width="991" alt="image"
src="https://github.com/user-attachments/assets/6bef28e0-19f3-46f5-af63-e31b4e77d575"
/>

* Embeddable (table): No change point found, with a reason
<img width="883" alt="image"
src="https://github.com/user-attachments/assets/628ba7fb-000c-45c3-9f23-2fd0535e5106"
/>

* Embeddable (table): No change point found, without a reason
<img width="983" alt="image"
src="https://github.com/user-attachments/assets/567c6127-267f-47a0-b280-52fb00c6c749"
/>

* Change Point Page: No change point found, with a reason
<img width="1217" alt="image"
src="https://github.com/user-attachments/assets/ab2fbeef-e4f6-4fa9-8cbe-c44abe0357b4"
/>

* Change Point Page: No change point found, without a reason
<img width="1225" alt="image"
src="https://github.com/user-attachments/assets/c16dd55a-37eb-45c2-a3eb-51ea9744e0d7"
/>

Fixes elastic#170388

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 1e7d418)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 2, 2025
…ion (#219072) (#222228)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[ML] AIOps: Enhance `No Results` state for Change Point Detection
(#219072)](#219072)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Robert
Jaszczurek","email":"92210485+rbrtj@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-02T15:09:46Z","message":"[ML]
AIOps: Enhance `No Results` state for Change Point Detection
(#219072)\n\nThis PR introduces new 'empty' states for Change Point
Detection page\nand embeddable.\nPreviously, if no change point was
found, we displayed an Empty State\nscreen. Now, we plot a sample metric
instead. For partitioned fields, we\nselect the first partition value
and plot a metric for it. If there is\nno data to plot for the selected
time range, this PR introduces a new\nempty state screen.\n\nNote:
Warnings in the embeddable will be displayed in the bottom-left\ncorner,
similar to how Lens embeddable warnings are shown. Currently, we\nare
waiting for the ability to push custom errors to the lens embeddable\n-
see https://github.com/elastic/kibana/issues/220208\n\n* Embeddable
(charts): No change point found, with a reason\n<img width=\"966\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/88d4f920-6739-4af7-9903-1fb210dfa089\"\n/>\n\n*
Embeddable (charts): No change point found, without a reason\n<img
width=\"991\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/6bef28e0-19f3-46f5-af63-e31b4e77d575\"\n/>\n\n*
Embeddable (table): No change point found, with a reason\n<img
width=\"883\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/628ba7fb-000c-45c3-9f23-2fd0535e5106\"\n/>\n\n\n*
Embeddable (table): No change point found, without a reason\n<img
width=\"983\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/567c6127-267f-47a0-b280-52fb00c6c749\"\n/>\n\n*
Change Point Page: No change point found, with a reason\n<img
width=\"1217\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/ab2fbeef-e4f6-4fa9-8cbe-c44abe0357b4\"\n/>\n\n*
Change Point Page: No change point found, without a reason\n<img
width=\"1225\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c16dd55a-37eb-45c2-a3eb-51ea9744e0d7\"\n/>\n\n\nFixes
https://github.com/elastic/kibana/issues/170388\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"1e7d418b3564004831920263333bac4136b15c7b","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement",":ml","Team:ML","Feature:ML/AIOps","backport:version","v9.1.0","v8.19.0"],"title":"[ML]
AIOps: Enhance `No Results` state for Change Point
Detection","number":219072,"url":"https://github.com/elastic/kibana/pull/219072","mergeCommit":{"message":"[ML]
AIOps: Enhance `No Results` state for Change Point Detection
(#219072)\n\nThis PR introduces new 'empty' states for Change Point
Detection page\nand embeddable.\nPreviously, if no change point was
found, we displayed an Empty State\nscreen. Now, we plot a sample metric
instead. For partitioned fields, we\nselect the first partition value
and plot a metric for it. If there is\nno data to plot for the selected
time range, this PR introduces a new\nempty state screen.\n\nNote:
Warnings in the embeddable will be displayed in the bottom-left\ncorner,
similar to how Lens embeddable warnings are shown. Currently, we\nare
waiting for the ability to push custom errors to the lens embeddable\n-
see https://github.com/elastic/kibana/issues/220208\n\n* Embeddable
(charts): No change point found, with a reason\n<img width=\"966\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/88d4f920-6739-4af7-9903-1fb210dfa089\"\n/>\n\n*
Embeddable (charts): No change point found, without a reason\n<img
width=\"991\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/6bef28e0-19f3-46f5-af63-e31b4e77d575\"\n/>\n\n*
Embeddable (table): No change point found, with a reason\n<img
width=\"883\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/628ba7fb-000c-45c3-9f23-2fd0535e5106\"\n/>\n\n\n*
Embeddable (table): No change point found, without a reason\n<img
width=\"983\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/567c6127-267f-47a0-b280-52fb00c6c749\"\n/>\n\n*
Change Point Page: No change point found, with a reason\n<img
width=\"1217\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/ab2fbeef-e4f6-4fa9-8cbe-c44abe0357b4\"\n/>\n\n*
Change Point Page: No change point found, without a reason\n<img
width=\"1225\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c16dd55a-37eb-45c2-a3eb-51ea9744e0d7\"\n/>\n\n\nFixes
https://github.com/elastic/kibana/issues/170388\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"1e7d418b3564004831920263333bac4136b15c7b"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219072","number":219072,"mergeCommit":{"message":"[ML]
AIOps: Enhance `No Results` state for Change Point Detection
(#219072)\n\nThis PR introduces new 'empty' states for Change Point
Detection page\nand embeddable.\nPreviously, if no change point was
found, we displayed an Empty State\nscreen. Now, we plot a sample metric
instead. For partitioned fields, we\nselect the first partition value
and plot a metric for it. If there is\nno data to plot for the selected
time range, this PR introduces a new\nempty state screen.\n\nNote:
Warnings in the embeddable will be displayed in the bottom-left\ncorner,
similar to how Lens embeddable warnings are shown. Currently, we\nare
waiting for the ability to push custom errors to the lens embeddable\n-
see https://github.com/elastic/kibana/issues/220208\n\n* Embeddable
(charts): No change point found, with a reason\n<img width=\"966\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/88d4f920-6739-4af7-9903-1fb210dfa089\"\n/>\n\n*
Embeddable (charts): No change point found, without a reason\n<img
width=\"991\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/6bef28e0-19f3-46f5-af63-e31b4e77d575\"\n/>\n\n*
Embeddable (table): No change point found, with a reason\n<img
width=\"883\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/628ba7fb-000c-45c3-9f23-2fd0535e5106\"\n/>\n\n\n*
Embeddable (table): No change point found, without a reason\n<img
width=\"983\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/567c6127-267f-47a0-b280-52fb00c6c749\"\n/>\n\n*
Change Point Page: No change point found, with a reason\n<img
width=\"1217\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/ab2fbeef-e4f6-4fa9-8cbe-c44abe0357b4\"\n/>\n\n*
Change Point Page: No change point found, without a reason\n<img
width=\"1225\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c16dd55a-37eb-45c2-a3eb-51ea9744e0d7\"\n/>\n\n\nFixes
https://github.com/elastic/kibana/issues/170388\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"1e7d418b3564004831920263333bac4136b15c7b"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Jaszczurek <92210485+rbrtj@users.noreply.github.com>
zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 4, 2025
…astic#219072)

This PR introduces new 'empty' states for Change Point Detection page
and embeddable.
Previously, if no change point was found, we displayed an Empty State
screen. Now, we plot a sample metric instead. For partitioned fields, we
select the first partition value and plot a metric for it. If there is
no data to plot for the selected time range, this PR introduces a new
empty state screen.

Note: Warnings in the embeddable will be displayed in the bottom-left
corner, similar to how Lens embeddable warnings are shown. Currently, we
are waiting for the ability to push custom errors to the lens embeddable
- see elastic#220208

* Embeddable (charts): No change point found, with a reason
<img width="966" alt="image"
src="https://github.com/user-attachments/assets/88d4f920-6739-4af7-9903-1fb210dfa089"
/>

* Embeddable (charts): No change point found, without a reason
<img width="991" alt="image"
src="https://github.com/user-attachments/assets/6bef28e0-19f3-46f5-af63-e31b4e77d575"
/>

* Embeddable (table): No change point found, with a reason
<img width="883" alt="image"
src="https://github.com/user-attachments/assets/628ba7fb-000c-45c3-9f23-2fd0535e5106"
/>


* Embeddable (table): No change point found, without a reason
<img width="983" alt="image"
src="https://github.com/user-attachments/assets/567c6127-267f-47a0-b280-52fb00c6c749"
/>

* Change Point Page: No change point found, with a reason
<img width="1217" alt="image"
src="https://github.com/user-attachments/assets/ab2fbeef-e4f6-4fa9-8cbe-c44abe0357b4"
/>

* Change Point Page: No change point found, without a reason
<img width="1225" alt="image"
src="https://github.com/user-attachments/assets/c16dd55a-37eb-45c2-a3eb-51ea9744e0d7"
/>


Fixes elastic#170388

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
…astic#219072)

This PR introduces new 'empty' states for Change Point Detection page
and embeddable.
Previously, if no change point was found, we displayed an Empty State
screen. Now, we plot a sample metric instead. For partitioned fields, we
select the first partition value and plot a metric for it. If there is
no data to plot for the selected time range, this PR introduces a new
empty state screen.

Note: Warnings in the embeddable will be displayed in the bottom-left
corner, similar to how Lens embeddable warnings are shown. Currently, we
are waiting for the ability to push custom errors to the lens embeddable
- see elastic#220208

* Embeddable (charts): No change point found, with a reason
<img width="966" alt="image"
src="https://github.com/user-attachments/assets/88d4f920-6739-4af7-9903-1fb210dfa089"
/>

* Embeddable (charts): No change point found, without a reason
<img width="991" alt="image"
src="https://github.com/user-attachments/assets/6bef28e0-19f3-46f5-af63-e31b4e77d575"
/>

* Embeddable (table): No change point found, with a reason
<img width="883" alt="image"
src="https://github.com/user-attachments/assets/628ba7fb-000c-45c3-9f23-2fd0535e5106"
/>


* Embeddable (table): No change point found, without a reason
<img width="983" alt="image"
src="https://github.com/user-attachments/assets/567c6127-267f-47a0-b280-52fb00c6c749"
/>

* Change Point Page: No change point found, with a reason
<img width="1217" alt="image"
src="https://github.com/user-attachments/assets/ab2fbeef-e4f6-4fa9-8cbe-c44abe0357b4"
/>

* Change Point Page: No change point found, without a reason
<img width="1225" alt="image"
src="https://github.com/user-attachments/assets/c16dd55a-37eb-45c2-a3eb-51ea9744e0d7"
/>


Fixes elastic#170388

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@nastasha-solomon nastasha-solomon changed the title [ML] AIOps: Enhance No Results state for Change Point Detection Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml release_note:enhancement Team:ML Team label for ML (also use :ml) t// v8.19.0 v9.1.0

6 participants