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 1.0] Monitor Details -> Monitor Summary -> Last test run panels #137059

Merged
merged 21 commits into from
Sep 21, 2022

Conversation

awahab07
Copy link
Contributor

@awahab07 awahab07 commented Jul 25, 2022

Summary

Tracked in #134204.

Adds the Last test run and Last 10 Test Runs panels on the Monitor Details -> Summary page. Both of the sections are added in one PR as the state is shared between the two UI sections.

  • A parent level Monitor Details directory is created which will house the Summary, History and Error related sub directories.
  • A copy is added when a monitor has never run and no information about last test run is available for the selected location. (wasn't in design)
  • For ping monitors, label-value list is added for Last test run instead of table of steps. (wasn't in design)
  • The title Last 10 Test Runs will switch to Test Runs if number of available past test runs are less than 10. (wasn't in design)
  • The empty Status trail histogram panel is hidden for now.

How to test

  1. Setup Kibana and a Synthetics project so that you are able to create monitors via UI as well as push project monitors.
  2. Create at least one browser and one lightweight monitor (HTTP, TCP or ICMP monitor).
  3. Push at least one browser monitor via @elastic/synthetics npm package.
  4. Wait a bit for the results to be ingested.
  5. Go to Synthetics -> Monitors -> click the ... menu of a monitor -> Go to monitor.
  6. Confirm that you can see expected data (as designs suggest) under Last test run and Last 10 Test Runs.
  7. Repeat steps 5 and 6 for other monitors.
  8. Bonus 1 - Use a private location to test the same steps.
  9. Bonus 2 - Push a Lightweight Project Monitor using a yaml as Lightweight Project Monitors are a new implementation. Consult the respective PR for instructions if you are up to it.

Screenshot 2022-07-25 at 17 35 46
Screenshot 2022-07-25 at 17 52 44

@awahab07 awahab07 force-pushed the summary-page-last-10-test-results branch 4 times, most recently from 4d2550b to 2126a46 Compare July 25, 2022 18:11
@awahab07 awahab07 marked this pull request as ready for review July 25, 2022 18:11
@awahab07 awahab07 requested a review from a team as a code owner July 25, 2022 18:11
@awahab07 awahab07 added Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.4.0 labels Jul 25, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@awahab07 awahab07 force-pushed the summary-page-last-10-test-results branch from 2126a46 to 1d43936 Compare July 26, 2022 16:29
@awahab07 awahab07 added v8.5.0 and removed v8.4.0 labels Jul 28, 2022
@awahab07 awahab07 force-pushed the summary-page-last-10-test-results branch from 1d43936 to 1b56356 Compare August 17, 2022 10:49
@dominiqueclarke
Copy link
Contributor

@elasticmachine merge upstream

</strong>
</EuiText>
),
header: 'Step',
Copy link
Contributor

Choose a reason for hiding this comment

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

i18n

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching.

import { EuiProgress, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { euiStyled } from '@kbn/kibana-react-plugin/common';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're transitioning to using emotion.

};

const BorderedTextLoading = euiStyled(EuiText)`
display: flex;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to be the same styles as above, so could be in a reusable variable.

border: 1px solid ${(props) => props.theme.eui.euiColorLightShade};
`;

export const LoadingImageState = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd check with @hbharding about loading states. I think I introduced this loading state in the original Uptime app, but design wasn't happy with it.

import { StepImageCaption } from './step_image_caption';
import { StepImagePopover } from './step_image_popover';

const StepDiv = euiStyled.div`
Copy link
Contributor

Choose a reason for hiding this comment

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

use emotion if possible.

const POPOVER_IMG_HEIGHT = 360;
const POPOVER_IMG_WIDTH = 640;

const StepImage = euiStyled(EuiImage)`
Copy link
Contributor

Choose a reason for hiding this comment

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

use emotion if possible.

const { syntheticsMonitor, syntheticsMonitorLoading } = useSelector(selectorMonitorDetailsState);
const dispatch = useDispatch();

const availableMonitor = monitorId
Copy link
Contributor

Choose a reason for hiding this comment

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

This nested ternary is hard to rease about. Can you refactor it as a switch or if else statement or a helper function of some sort.

Comment on lines 13 to 15
<>
<MonitorDetailsTabs />
</>
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
<>
<MonitorDetailsTabs />
</>
<MonitorDetailsTabs />

}

// TODO: Remove the following along with the rest route if not needed
export const fetchMonitorStatus = async (params: QueryParams): Promise<Ping> => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this isn't being used after all. Let's delete it.

import {
ScreenshotBlockDoc,
ScreenshotBlockCache,
isPendingBlock,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is a helper function being imported from runtime_types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering isPendingBlock is a type guard, runtime_types seems a suitable common place. (Also, isScreenshotBlockDoc, another related type guard, was already exported in there)

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.

Lightweight Pings

Lightweight pings contain a hyperlink on the monitor time execution time. This links to the waterfall chart. Hyperlinks should be excluded for lightweight monitors as no further data is available for lightweight monitors in the waterfall chart.
Screen Shot 2022-08-29 at 10 52 49 AM

Browser pings

image
The hyperlink for the waterfall chart in the last test run panel is broken. Notably, the check group appears to be wrong. The check group for the last test run seems to be correct, while the check group for the last test run reported in the last 10 panel is different.

Also, the screenshot in the table is missing. For reference, here is a screenshot from Figma.
Screen Shot 2022-08-29 at 11 46 08 AM

Project monitors

Screen Shot 2022-08-29 at 11 36 47 AM

Last 10 test runs doesn't work with project monitors

@awahab07 awahab07 force-pushed the summary-page-last-10-test-results branch from 4617f75 to 45c5423 Compare September 20, 2022 18:03
@dominiqueclarke dominiqueclarke self-requested a review September 20, 2022 20:20
@awahab07
Copy link
Contributor Author

Updated the implementation to match the updated design (journey and step screenshots)
image

@shahzad31
Copy link
Contributor

Waterfall is opening in new tab, i think it should remain in same tab

image

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.

Overall looks great and works as expected.
Code is very clean and well organised.

Great work !!

Please do a follow up to add some e2e test journey for these panels .
I tested this with Browser monitors and an HTTP Monitors.

I can see that it's display a detail panel for ping monitors.

And display step lists for browser monitors.

@awahab07 awahab07 force-pushed the summary-page-last-10-test-results branch 2 times, most recently from f0eb58a to 5b9eee7 Compare September 21, 2022 14:02
@awahab07 awahab07 force-pushed the summary-page-last-10-test-results branch from 5b9eee7 to 5902b5f Compare September 21, 2022 14:39
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
synthetics 969 992 +23

Async chunks

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

id before after diff
synthetics 993.1KB 1021.1KB +28.0KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
synthetics 24.1KB 24.1KB +56.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
synthetics 59 60 +1

Total ESLint disabled count

id before after diff
synthetics 65 66 +1

History

  • 💚 Build #74389 succeeded f0eb58aba27b945f8c2eb3884e3df7f513106e9f
  • 💛 Build #74360 was flaky 9b6bbb6ed8f4e236cbfe6eed058521362a4e8403
  • 💚 Build #74325 succeeded d29a71b8ecb5b0777df20e4fc668aa815c3b0a19
  • 💚 Build #74211 succeeded 2fe885605bb9e370fd0b24d98fc17b0fd9e8d05b
  • 💚 Build #66927 succeeded 4617f7581cb413f74a2677739c98a5d48067254c
  • 💔 Build #66766 failed de47f53e11237cc1d43d06592c6a8ac244fb42fc

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

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

@awahab07 awahab07 merged commit fdbf462 into elastic:main Sep 21, 2022
@justinkambic
Copy link
Contributor

In Post-FF testing I've observed that the last test run info block at the top of the page isn't showing up for project monitors. There aren't any pending network requests in my browser either, so it's likely isolated to the client, or we're getting null data back and not handling it in the loading logic:

image

image

It's working properly for the monitors I'm managing via the synthetics UI, and a private location:

image

image

image

Aside from these project monitor issues, I'm seeing the appropriate data show up for my monitors as specified in the testing instructions.

@paulb-elastic
Copy link
Contributor

Raised #143059 as per @justinkambic's comment

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 release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants