Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics] modify use overview status hook to mimic use_monitor_list #210936

Conversation

baileycash-elastic
Copy link
Contributor

@baileycash-elastic baileycash-elastic commented Feb 12, 2025

Resolves #197066

Summary

Two methods explored:

  • adding loading boolean to conditions that would execute quietAction to account for renders without completed data loads
  • modifying hook to mimic use_monitor_list here
Screenshot 2025-02-12 at 4 27 38 PM

Risks

Debounce was introduced for an api call which may impact UX and data availability in limited cases.

Two methods explored:
- adding loading boolean to conditions that would execute quietAction
- modifying hook to mimic use_monitor_list
@baileycash-elastic baileycash-elastic added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) Team:obs-ux-management Observability Management User Experience Team v9.1.0 v8.19.0 labels Feb 12, 2025
@baileycash-elastic baileycash-elastic changed the title modify use overview status hook to mimic use_monitor_list [Synthetics] modify use overview status hook to mimic use_monitor_list Feb 12, 2025
@baileycash-elastic baileycash-elastic marked this pull request as ready for review February 12, 2025 22:02
@baileycash-elastic baileycash-elastic requested a review from a team as a code owner February 12, 2025 22:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@baileycash-elastic
Copy link
Contributor Author

@elasticmachine merge upstream

Comment on lines 53 to 65
useDebounce(
() => {
// Don't load on initial mount, only meant to handle pageState changes
if (isInitialMount.current || !loaded) {
if (loaded) {
// setting false here to account for debounce timing
isInitialMount.current = false;
return;
}
dispatch(fetchOverviewStatusAction.get({ pageState, scopeStatusByLocation }));
}
},
100,
[pageState, scopeStatusByLocation]
);
Copy link
Contributor

Choose a reason for hiding this comment

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

when pageState is changed, after initial loaded state, this will never be called.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed now

@baileycash-elastic baileycash-elastic force-pushed the overview-status-api-redundancy branch from d48ea00 to f6a25db Compare February 19, 2025 15:38
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
synthetics 788.4KB 788.7KB +225.0B

History

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM !!

@baileycash-elastic baileycash-elastic merged commit 258eef7 into elastic:main Feb 20, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x, 9.0

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 20, 2025
elastic#210936)

Resolves elastic#197066

## Summary

Two methods explored:
- adding loading boolean to conditions that would execute quietAction to
account for renders without completed data loads
- modifying hook to mimic use_monitor_list
[here](https://github.com/baileycash-elastic/kibana/blob/main/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts)

<img width="1722" alt="Screenshot 2025-02-12 at 4 27 38 PM"
src="https://github.com/user-attachments/assets/4ca9638b-6fa6-4a1d-8818-af3232f1fdf5"
/>

## Risks
Debounce was introduced for an api call which may impact UX and data
availability in limited cases.

(cherry picked from commit 258eef7)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 20, 2025
elastic#210936)

Resolves elastic#197066

## Summary

Two methods explored:
- adding loading boolean to conditions that would execute quietAction to
account for renders without completed data loads
- modifying hook to mimic use_monitor_list
[here](https://github.com/baileycash-elastic/kibana/blob/main/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts)

<img width="1722" alt="Screenshot 2025-02-12 at 4 27 38 PM"
src="https://github.com/user-attachments/assets/4ca9638b-6fa6-4a1d-8818-af3232f1fdf5"
/>

## Risks
Debounce was introduced for an api call which may impact UX and data
availability in limited cases.

(cherry picked from commit 258eef7)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x
9.0

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 Feb 20, 2025
…or_list (#210936) (#211932)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Synthetics] modify use overview status hook to mimic
use_monitor_list
(#210936)](#210936)

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

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

<!--BACKPORT [{"author":{"name":"Bailey
Cash","email":"bailey.cash@elastic.co"},"sourceCommit":{"committedDate":"2025-02-20T16:50:08Z","message":"[Synthetics]
modify use overview status hook to mimic use_monitor_list
(#210936)\n\nResolves #197066\n\n## Summary\n\nTwo methods explored:\n-
adding loading boolean to conditions that would execute quietAction
to\naccount for renders without completed data loads\n- modifying hook
to mimic
use_monitor_list\n[here](https://github.com/baileycash-elastic/kibana/blob/main/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts)\n\n<img
width=\"1722\" alt=\"Screenshot 2025-02-12 at 4 27
38 PM\"\nsrc=\"https://github.com/user-attachments/assets/4ca9638b-6fa6-4a1d-8818-af3232f1fdf5\"\n/>\n\n##
Risks\nDebounce was introduced for an api call which may impact UX and
data\navailability in limited
cases.","sha":"258eef7e37745a63256fdc56b32b21e3b103ec2a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0","v8.19.0"],"title":"[Synthetics]
modify use overview status hook to mimic
use_monitor_list","number":210936,"url":"https://github.com/elastic/kibana/pull/210936","mergeCommit":{"message":"[Synthetics]
modify use overview status hook to mimic use_monitor_list
(#210936)\n\nResolves #197066\n\n## Summary\n\nTwo methods explored:\n-
adding loading boolean to conditions that would execute quietAction
to\naccount for renders without completed data loads\n- modifying hook
to mimic
use_monitor_list\n[here](https://github.com/baileycash-elastic/kibana/blob/main/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts)\n\n<img
width=\"1722\" alt=\"Screenshot 2025-02-12 at 4 27
38 PM\"\nsrc=\"https://github.com/user-attachments/assets/4ca9638b-6fa6-4a1d-8818-af3232f1fdf5\"\n/>\n\n##
Risks\nDebounce was introduced for an api call which may impact UX and
data\navailability in limited
cases.","sha":"258eef7e37745a63256fdc56b32b21e3b103ec2a"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210936","number":210936,"mergeCommit":{"message":"[Synthetics]
modify use overview status hook to mimic use_monitor_list
(#210936)\n\nResolves #197066\n\n## Summary\n\nTwo methods explored:\n-
adding loading boolean to conditions that would execute quietAction
to\naccount for renders without completed data loads\n- modifying hook
to mimic
use_monitor_list\n[here](https://github.com/baileycash-elastic/kibana/blob/main/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts)\n\n<img
width=\"1722\" alt=\"Screenshot 2025-02-12 at 4 27
38 PM\"\nsrc=\"https://github.com/user-attachments/assets/4ca9638b-6fa6-4a1d-8818-af3232f1fdf5\"\n/>\n\n##
Risks\nDebounce was introduced for an api call which may impact UX and
data\navailability in limited
cases.","sha":"258eef7e37745a63256fdc56b32b21e3b103ec2a"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
kibanamachine added a commit that referenced this pull request Feb 20, 2025
…or_list (#210936) (#211931)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Synthetics] modify use overview status hook to mimic
use_monitor_list
(#210936)](#210936)

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

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

<!--BACKPORT [{"author":{"name":"Bailey
Cash","email":"bailey.cash@elastic.co"},"sourceCommit":{"committedDate":"2025-02-20T16:50:08Z","message":"[Synthetics]
modify use overview status hook to mimic use_monitor_list
(#210936)\n\nResolves #197066\n\n## Summary\n\nTwo methods explored:\n-
adding loading boolean to conditions that would execute quietAction
to\naccount for renders without completed data loads\n- modifying hook
to mimic
use_monitor_list\n[here](https://github.com/baileycash-elastic/kibana/blob/main/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts)\n\n<img
width=\"1722\" alt=\"Screenshot 2025-02-12 at 4 27
38 PM\"\nsrc=\"https://github.com/user-attachments/assets/4ca9638b-6fa6-4a1d-8818-af3232f1fdf5\"\n/>\n\n##
Risks\nDebounce was introduced for an api call which may impact UX and
data\navailability in limited
cases.","sha":"258eef7e37745a63256fdc56b32b21e3b103ec2a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-management","v9.1.0","v8.19.0"],"title":"[Synthetics]
modify use overview status hook to mimic
use_monitor_list","number":210936,"url":"https://github.com/elastic/kibana/pull/210936","mergeCommit":{"message":"[Synthetics]
modify use overview status hook to mimic use_monitor_list
(#210936)\n\nResolves #197066\n\n## Summary\n\nTwo methods explored:\n-
adding loading boolean to conditions that would execute quietAction
to\naccount for renders without completed data loads\n- modifying hook
to mimic
use_monitor_list\n[here](https://github.com/baileycash-elastic/kibana/blob/main/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts)\n\n<img
width=\"1722\" alt=\"Screenshot 2025-02-12 at 4 27
38 PM\"\nsrc=\"https://github.com/user-attachments/assets/4ca9638b-6fa6-4a1d-8818-af3232f1fdf5\"\n/>\n\n##
Risks\nDebounce was introduced for an api call which may impact UX and
data\navailability in limited
cases.","sha":"258eef7e37745a63256fdc56b32b21e3b103ec2a"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210936","number":210936,"mergeCommit":{"message":"[Synthetics]
modify use overview status hook to mimic use_monitor_list
(#210936)\n\nResolves #197066\n\n## Summary\n\nTwo methods explored:\n-
adding loading boolean to conditions that would execute quietAction
to\naccount for renders without completed data loads\n- modifying hook
to mimic
use_monitor_list\n[here](https://github.com/baileycash-elastic/kibana/blob/main/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts)\n\n<img
width=\"1722\" alt=\"Screenshot 2025-02-12 at 4 27
38 PM\"\nsrc=\"https://github.com/user-attachments/assets/4ca9638b-6fa6-4a1d-8818-af3232f1fdf5\"\n/>\n\n##
Risks\nDebounce was introduced for an api call which may impact UX and
data\navailability in limited
cases.","sha":"258eef7e37745a63256fdc56b32b21e3b103ec2a"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.19.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Synthetics] Overview status api is called twice on management page on load
4 participants