kibana/x-pack/plugins/monitoring
Chris Roberson f2bb7dbf9d
[Monitoring] APM Monitoring UI (#22975)
* Merge in boilerplate branch

* Manually copy over the specific metrics and UIs

* Add api integration tests

* Fix tests

* Remove unused metrics

* Update snapshot

* Fix tests

* Remove types agg

* Use ApmClusterMetric

* provide description for apm-server monitoring metrics (#23331)

* Vis LESS to SASS (cont.) (#23199)

* Tweak migrations integraiton tests to have a stable sort (#23265)

* Fix: plugin api route with security enabled (#23334)

Closes https://github.com/elastic/kibana/issues/23266

This is more of a quick fix than the final solution. The issue was that Canvas tries to check the plugins API without checking to see if the user it logged in. As a result, instead of the plugins response, it gets the HTML from the login page and that causes an error to be thrown when attempting to parse the results.

For now, this PR just disables the auth requirement on the Canvas plugin API endpoint.

* [migrations/tests] sort results before assertion (#23347)

There have been several failures in this test, seemingly caused by a lack of sorting in the results. It makes sense that since both migrations are run simultaneously that sometimes one would succeed and sometimes another would, so I've just sorted the results before checking.

![image](https://user-images.githubusercontent.com/1329312/45791153-44e9cc80-bc3d-11e8-88c4-760d4c7b35bd.png)

cc: @chrisdavies

* [ML] Moves custom URL editor Add button and form to top of flyout (#23326)

* [ML] Moves custom URL editor Add button and form to top of flyout

* [ML] Edits to custom URL editor class name

* Graph LESS to SASS (#23348)

* Developer documentation for integrating with the telemetry service (#23295)

* Developer documentation for integrating with the telemetry service

* open with a bang

* more faqs

* thing about tracking ui interactions

* talk to the plat team

* create and register

* Fix a bug where ES sends a string and migrations expect a boolean (#23313)

* chore: use cheerio in i18n.html.getDirectiveMessages (#23342)

this was only using jsdom to parse html, but cheerio allows parsing html without requiring a dom. cheerio was also already in the dependency list.

* [core/utils] add shareWeakReplay() operator (#23333)

* Chore: fix canvas test runner (#23336)

Blocked by https://github.com/elastic/kibana/pull/23342

This fixes the local test runner in Canvas. It should not affect anything else, including the CI test runner.

- Bumps JSDOM to ^12.0.0
  - I matched Kibana's version on migration, but nothing else in X-Pack uses JSDOM, so we can use the newer version (which has a very different API)
  - I had to match it because of a script that enforces version matching, but #23342 removed jsdom from Kibana, so we no longer have a version to match
- Restores the local `.babelrc` file
  - I thought it was only used for building plugins; I was wrong 😢

* Convert Discover open top nav to EUI flyout (#22971)

* move find logic to SavedObjectFinder component since savedObjectClient is no longer coupled to angular

* implement flyout open saved searches

* remove old open stuff

* add jest test for OpenSearchPanel and simplify panel title

* fix functional tests

* fix _lab_mode functional test

* Migrate save top nav in Discover and Visualize to EUI (#23190)

* extract reusable save component from DashboardSaveModal

* update discover search to use SavedObjectSaveModal

* create generic show_save_model that works for both discover and dashboard

* fix last bits of discover save

* remove old save functionallity

* migrate visualize save to EUI

* fix functional tests

* disable save button if title is empty

* mark title input as invalid when title is not provided

* fix funtional tests

* Moves styleSheetPath to uiExports (#23007)

This was previously defined in uiExports.app, which limited plugins which are not an app of providing a stylesheet. This allows any plugin to define a stylesheet which will be available on page load.

* Timelion less to sass (#23339)

* Consistent casing

* Fix snapshot

* Update tests
2018-09-24 12:59:18 -04:00
..
__tests__ Deprecate xpack:defaultAdminEmail for monitoring alerts (#22195) 2018-09-06 10:26:05 -04:00
common Deprecate xpack:defaultAdminEmail for monitoring alerts (#22195) 2018-09-06 10:26:05 -04:00
public [Monitoring] APM Monitoring UI (#22975) 2018-09-24 12:59:18 -04:00
server [Monitoring] APM Monitoring UI (#22975) 2018-09-24 12:59:18 -04:00
.agignore Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00
.kibana-plugin-helpers.json Convert all Less files to Sass in monitoring, use EUI variable scope (#20995) 2018-08-13 08:18:08 -07:00
config.js Deprecate xpack:defaultAdminEmail for monitoring alerts (#22195) 2018-09-06 10:26:05 -04:00
deprecations.js Deprecate xpack:defaultAdminEmail for monitoring alerts (#22195) 2018-09-06 10:26:05 -04:00
index.js Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00
init.js [Monitoring] Fix logging when Monitoring reinitializes with HUP signal (#22464) 2018-08-29 11:33:27 -07:00
README.md Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00
ui_exports.js Moves styleSheetPath to uiExports (#23007) 2018-09-20 19:01:06 -07:00

Using Monitoring

The easiest way to get to know the new Monitoring is probably by reading the docs.

Install the distribution the way a customer would is pending the first release of Unified X-Pack plugins.

Developing

You will need to get Elasticsearch and X-Pack plugins for ES that match the version of the UI. The best way to do this is to run gradle run from a clone of the x-plugins repository.

To set up Monitoring and automatic file syncing code changes into Kibana's plugin directory, clone the kibana and x-plugins repos in the same directory and from x-plugins/kibana/monitoring, run yarn start.

Once the syncing process has run at least once, start the Kibana server in development mode. It will handle restarting the server and re-optimizing the bundles as-needed. Go to https://localhost:5601 and click Monitoring from the App Drawer.

Running tests

  • Run the command:

    yarn test
    
  • Debug tests Add a debugger line to create a breakpoint, and then:

    gulp sync && mocha debug --compilers js:babel-register /pathto/kibana/plugins/monitoring/pathto/__tests__/testfile.js
    

Deploying

Monitoring is part of XPack, and only a single XPack artifact needs to be deployed. Previously, the instructions to deploy were:

The release task creates archives and uploads them to download.elasticsearch.org/elasticsearch/monitoring/VERSION. You will need S3 credentials in $HOME/.aws-config.json. Format as so:

{
  "key":"MY_KEY_HERE",
  "secret":"your/long/secret/string"
}

To upload the current archive as the "latest" release, use:

gulp release

Multicluster Setup for Development

To run the UI with multiple clusters, the easiest way is to run 2 nodes out of the same Elasticsearch directory, but use different start up commands for each one. One node will be assigned to the "monitoring" cluster and the other will be for the "production" cluster.

  1. Add the Security users:
% ./bin/x-pack/users useradd -r remote_monitoring_agent -p notsecure remote
% ./bin/x-pack/users useradd -r monitoring_user -p notsecure monitoring_user
  1. Start up the Monitoring cluster:
% ./bin/elasticsearch \
-Ehttp.port=9210 \
-Ecluster.name=monitoring \
-Epath.data=monitoring-data \
-Enode.name=monitor1node1
  1. Start up the Production cluster:
% ./bin/elasticsearch \
-Expack.monitoring.exporters.id2.type=http \
-Expack.monitoring.exporters.id2.host=http://127.0.0.1:9210 \
-Expack.monitoring.exporters.id2.auth.username=remote \
-Expack.monitoring.exporters.id2.auth.password=notsecure \
-Ecluster.name=production \
-Enode.name=prod1node1 \
-Epath.data=production-data
  1. Set the Kibana config:
% cat config/kibana.dev.yml
xpack.monitoring.elasticsearch:
  url: "http://localhost:9210"
  username: "kibana"
  password: "changeme"
  1. Start another Kibana instance:
% yarn start
  1. Start a Kibana instance connected to the Monitoring cluster (for running queries in Sense on Monitoring data):
% ./bin/kibana --config config/kibana.dev.yml --elasticsearch.url http://localhost:9210 --server.name monitoring-kibana --server.port 5611