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

[Monitoring] APM UI boilerplate #22453

Merged

Conversation

chrisronline
Copy link
Contributor

@chrisronline chrisronline commented Aug 28, 2018

This PR introduces the boilerplate code necessary to add the APM presence in the monitoring UI. Most of this work is a simple copy/paste from other examples and I wanted to remove it from the main PR to ensure the reviewers had an opportunity to only see the significant code changes.

This includes the following setup, all contained under x-pack/plugins/monitoring:

  • server/routes/api/v1/apm
    • This includes routes for the retrieving data from the UI:
      • /api/monitoring/v1/clusters/{clusterUuid}/apm
      • /api/monitoring/v1/clusters/{clusterUuid}/apm/instances
      • /api/monitoring/v1/clusters/{clusterUuid}/apm/{apmUuid}
  • server/lib/apm
    • This includes various utility functions that facilitate fetching the relevant monitoring data from the route code
  • public/views/apm
    • These are the angular routes that load the angular directives
  • public/directives/apm
    • These are the angular directives that load the react components. I think these are necessary because of the time picker being in angular and us needing to update the graphs based on changes to it
  • public/components/apm
    • These are the react components that render the UI

NOTE:

  1. Ignore the commit history here. I did all the work in a single branch and decided to break it apart later.
  2. This will be merged into the feature branch but this PR shows master to make CI work properly.

chrisronline and others added 30 commits August 2, 2018 14:50
…ing messages (elastic#22243)

* Update buildHierarchicalData test.
* Rebuild modulePath correctly if on Windows

* Change how we find dashboard add panel is loaded

* Add and use find.byClassName instead of remote

* cleanup a comment
elastic#22124)

translate tutorials(osquery_logs, php_fpm_metrics, postgresql_logs, postgresql_metrics, prometheus_metrics, rabbitmq_metrics, redis_logs)
elastic#22122)

translate tutorials(kafka_logs, kafka_metrics, kibana_metrics, kubernetes_metrics, logstash_logs, logstash_metrics, memcached_metrics)
elastic#22121)

translate tutorials(elasticsearch_metrics, etcd_metrics, golang_metrics, haprozy_metrics, iis_logs)
Upgrades EUI from 3.6.1 => 3.7.0
jbudz and others added 2 commits September 10, 2018 15:17
* [ci] use es snapshots on non pull requests

* remove extra export

* always clone
…om Kibana filter (elastic#22885)

* handle case where value can not be extracted from Kibana filter

* review feedback
@tsullivan
Copy link
Member

Would you have cycles to review this?

Yes! I will take a look tomorrow

Spencer and others added 8 commits September 11, 2018 08:38
…stic#22814)

This PR addresses parts of elastic#22642:
- It gets rid of the use of var that = this;.
- dragSelect's action strings are moved to a constants file.
- Adds jest tests for the ExplorerSwimlane component.

This also fixes the following bugs:
- The way we subscribe listeners to the events of the dragSelect library could result in the same event being triggered multiple times. This in turn could cause race conditions when on each event new data gets fetched but in between angular's scope gets updated and could end up in a non-intended way. The result of this were view-by swimlanes not updating correctly or anomaly charts showing non-related charts. This PR fixes it by filtering out consecutive swimlane click events.
- When the angular based chart container wrapper directive gets destroyed/re-esetup when using the job pick, it missed unmounting the react component, it didn't trigger componentWillUnmount()and didn't unsubscribe from dragSelectListener.
…ic#22379)

Allows Kibana users to configure the max_concurrent_shard_requests param used by Kibana when sending _msearch requests. Exposes the config as an advanced setting. By default we won't send the param at all, relying on the ES default instead.
…lastic#22904)

The `deepFreeze()` function used by `core.injectedMetadata` uses a recursive type definition to indicate that all of the child types within the passed argument become readonly, which works fine for objects but represents arrays as objects instead of using the `ReadonlyArray<>` type. 

This PR fixes the type definition to use a `RecursiveReadonlyArray<>` type that properly represents arrays with their methods like `push()`, and iterates into the array properly to propagate `ReadOnly<>`, as proven by the tests.
* conditionalize Monitoring tests for Cloud testing

* make security_page/login wait

* revert these files from another PR

* revert these files from another PR
<KuiTableRowCell>
<div className="monitoringTableCell__name">
<EuiLink
onClick={goToInstance.bind(null, get(props, 'beat.uuid'))}
Copy link
Member

Choose a reason for hiding this comment

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

Does just using href work, instead of onClick ?

instance="{{ pageData.apmSummary.name }}"
data-test-subj="apmInstancePage"
>
<monitoring-apm-server-instance data="pageData"></monitoring-apm-server-instance>
Copy link
Member

Choose a reason for hiding this comment

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

We're able to reduce the amount of Angular/React mix by putting a DOM element here for React to mount to, and have the view render react into this template. I've added a helper view controller class called MonitoringViewBaseController. That should help reduce a lot of the boilerplate bulk. IIRC, you don't even need a getPageData function.

public/views/elasticsearch/overview/controller.js is an example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good!

…#21505)

* Default to chromium and add deprecation warning for phantom.

* use int, not float
@@ -27,3 +27,6 @@ import './kibana/summary';
import './beats/overview';
import './beats/listing';
import './beats/beat';
import './apm/instance';
import './apm/instances';
import './apm/overview';
Copy link
Member

Choose a reason for hiding this comment

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

If we mount react components directly from the Angular view, we should not need any Angular directives. Over time with refactoring, we shouldn't need this file at all

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great!

pavel06081991 and others added 7 commits September 11, 2018 22:55
* migrate reporting top nav to sharing menu

* pass share extensions to visualize share menu

* start creating the reporting panel component

* add buttons

* generate report generatation URL

* require save if url changes

* add print layout UI

* putting it all together - generate reports from share context menu

* ensure copy button fills entire menu width

* inject job params functionallity

* refactor print layout out of ReportingContentPanel

* CSV report generation

* disable report generation when app is dirty

* update URL when window is resized

* remove all the old stuff

* clean up CSV report register provider

* fix typescript errors

* fix functional retests

* remove failure_debug folder

* close popover when generate button clicked, more work on functional tests

* set size on button and text, do not use EuiFormRow

* use ReactElement type

* move ShareContextMenuExtensionsRegistryProvider to ui/share and create interfaces for registy

* strictor typing, do not use hard coded object type name

* move registry files to typescript

* remove destructuring in the interface

* convert createReportingJob to async function, remove unneeded comment
- The aim of this is to more clearly visualize how the timerange of the cell selected in the swimlane relates to the time span shown in the charts.
- The most important change is that the vertical date axis ticks no longer are randomly positioned by d3. Instead they are aligned with the cell interval of the swimlane. This way, the date information shown in the swimlane tooltip will always align with the date tick shown left of the emphasized area in the chart.
- The highlighted area now features a gray rounded border to resemble the styling of the selected cell in the swimlane.
- The chart also fixes where to long chart headers would wrap the "View" link to a new line.
- The x/y axis labels blackness has been reduced to reduce emphasis on the labels.
@chrisronline
Copy link
Contributor Author

@tsullivan Good suggestions around! Thanks for pointing that out. Updated now

@elasticmachine
Copy link
Contributor

💔 Build Failed

@tsullivan
Copy link
Member

Looks like you got the idea! With the base controller class, you should also be able to see a Loading page render briefly while we're waiting for the page data. If you throttle your network speed a little, you should be able to see it for longer.

@chrisronline chrisronline changed the base branch from master to monitoring/apm_ui September 12, 2018 17:34
@chrisronline chrisronline merged commit 27ebd27 into elastic:monitoring/apm_ui Sep 12, 2018
@elasticmachine
Copy link
Contributor

💔 Build Failed

@chrisronline chrisronline deleted the monitoring/apm-boilerplate branch September 12, 2018 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.