Skip to content

[Synthetics] Add monitor detail flyout #136156

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

Merged
merged 118 commits into from
Nov 7, 2022

Conversation

justinkambic
Copy link
Contributor

@justinkambic justinkambic commented Jul 11, 2022

Summary

Note to reviewers: you can test this PR using the cloud deployment.

Credentials are available here.

Resolves #135150.

Introduces monitor detail flyout for Synthetics UI.

20220906164016

Additional notes

There are a few modifications to functionality that was merged previously. I've extracted the toast notifications for the enable/disable hook to an effect that is tied to the redux action responsible for the actual API request. There were numerous cases where the current solution is vulnerable to multiple notification calls because they're inferring when the send a toast based on local app state.

This way, the notification is tied to the resolution of the request, and it handles errors as well.

Testing

Some high-level things to test in addition to regular review scrutiny:

  • Viewing and opening the flyout via the actions popover
  • Opening popover by clicking metric items
  • Enable/disable monitor(s) via the flyout and actions popover

@justinkambic justinkambic added release_note:enhancement enhancement New value added to drive a business result Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.4.0 labels Jul 11, 2022
@justinkambic justinkambic self-assigned this Jul 11, 2022
Comment on lines 54 to 71
const STATUS_COLUMN_NAME = i18n.translate('xpack.synthetics.monitorList.statusColumnName', {
defaultMessage: 'Status',
});

const LOCATION_COLUMN_NAME = i18n.translate('xpack.synthetics.monitorList.locationColumnName', {
defaultMessage: 'Location',
});

const DURATION_HEADER_TEXT = i18n.translate('xpack.synthetics.monitorList.durationHeaderText', {
defaultMessage: 'Duration',
});

const MONITOR_DETAILS_HEADER_TEXT = i18n.translate(
'xpack.synthetics.monitorList.monitorDetailsHeaderText',
{
defaultMessage: 'Monitor Details',
}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move these to the bottom of file, we have been following this pattern to keep i18n in end of file, to make component more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, hadn't really intended for this to be reviewed yet 😆

Comment on lines 122 to 123
{status === FETCH_STATUS.LOADING && <EuiLoadingSpinner size="xl" />}
{status === FETCH_STATUS.SUCCESS && (
Copy link
Contributor

Choose a reason for hiding this comment

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

would be easier to use loading prop returned from useFetched?

Comment on lines 194 to 197
reportDefinitions: {
'monitor.id': [id],
'observer.geo.name': [location],
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
reportDefinitions: {
'monitor.id': [id],
'observer.geo.name': [location],
},
reportDefinitions: {
'monitor.id': [id],
},
filters: [
{
field: "observer.geo.name",
values: [location]
}
],

Copy link
Contributor

Choose a reason for hiding this comment

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

it translate to better UI in exp view

[id]
);
const { data: detailData, status: detailStatus } = useFetcher(() => {
return fetchPings({
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we should be using legacy uptime fetchPings. I believe our goal is to use the data plugin or the useEsQuery hook moving forward. Thoughts @shahzad31 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, this legacy query likely filters by monitor.id, whereas we'll want to filter by config_id moving forward.

{!!detailId && (
<MonitorDetailFlyout
id={detailId}
location="North America - US Central"
Copy link
Contributor

Choose a reason for hiding this comment

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

This will likely be the monitor id, not the monitor location name.

@justinkambic justinkambic force-pushed the 135150/monitor-detail-flyout branch 4 times, most recently from 8ee2373 to 888eb64 Compare July 13, 2022 20:47
@dominiqueclarke
Copy link
Contributor

@elasticmachine merge upstream

@justinkambic justinkambic force-pushed the 135150/monitor-detail-flyout branch from a3c005f to 5e3b0eb Compare October 24, 2022 19:54
Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

Screen Shot 2022-10-25 at 7 20 06 PM

Duration chart is not rendered for project monitors, but honestly I'm considering deferring this fix until https://github.com//issues/143309

image

Tags still look a little off
image

This should be HTTP, TCP, ICMP, Multistep, or Single Page I believe. The value is available at attributes[ConfigKey.FORM_MONITOR_TYPE]

@justinkambic
Copy link
Contributor Author

@dominiqueclarke I think I have addressed all the feedback from your last review except for the issue with Project Monitors. If you'd like, we can add this to the list of things we plan to iteratively fix. I'm going to make a follow-up issue detailing items we are blocked on or delaying for various reasons.

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

LGTM

@shahzad31 shahzad31 enabled auto-merge (squash) November 7, 2022 15:54
@kibana-ci
Copy link
Collaborator

kibana-ci commented Nov 7, 2022

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
synthetics 1015 1018 +3

Async chunks

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

id before after diff
synthetics 1.1MB 1.1MB +12.2KB
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 58 64 +6
osquery 108 113 +5
securitySolution 440 446 +6
total +19

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 66 72 +6
osquery 109 115 +6
securitySolution 517 523 +6
total +20

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @justinkambic

Copy link
Contributor

@hbharding hbharding left a comment

Choose a reason for hiding this comment

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

lgtm thanks @justinkambic

@shahzad31 shahzad31 merged commit 31f3105 into elastic:main Nov 7, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 7, 2022
@shahzad31 shahzad31 deleted the 135150/monitor-detail-flyout branch November 7, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:cloud-deploy Create or update a Cloud deployment enhancement New value added to drive a business result release_note:enhancement Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Synthetics UI] [Overview] Monitor details flyout
7 participants