-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Monitoring] Migrate server to NP #56675
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
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
9ed5142
First pass
chrisronline dd0db06
First pass
chrisronline 82f1982
Add new routes
chrisronline 1e2f1ae
Getting closer
chrisronline 9bce109
Remove legacy server code, and other fixes
chrisronline 75c76e1
Register the plugin with xpack
chrisronline f03b070
Pass a legacy client to telemetry
chrisronline d3983b2
Suport callWithInternalUser
chrisronline 6493cd7
Remove this
chrisronline 3cd3c1e
Merge in master
chrisronline db4edbd
More NP work
chrisronline a5bb47d
Fix some tests
chrisronline 32cb3d4
Merge in master
chrisronline 243fa22
Fix broken test
chrisronline 3592198
t push oMerge remote-tracking branch 'elastic/master' into np
chrisronline a5c5f26
Merge in master
chrisronline d4b5f32
Move over new telemetry changes, and fix other issues
chrisronline cc1af1a
Fix TODO item
chrisronline 38bcbc5
Merge in master
chrisronline 2556eb9
Reuse the same schema as elasticsearch module
chrisronline 24c68bd
Use a singular config definition here
chrisronline b190853
Disable this for now
chrisronline 7188464
Use the right method
chrisronline 059863b
Use custom config again
chrisronline d779922
Tweak the config to make this optional
chrisronline f237dd4
Remove these
chrisronline b6d550f
Remove these unnecessary files
chrisronline b0ab817
Fix jest test
chrisronline 906b866
Fix some linting issues
chrisronline 048845d
Fix type issue
chrisronline be081ce
Merge in master
chrisronline 9da2a63
Fix localization issues
chrisronline b9e7e48
Use the elasticsearch config
chrisronline 3af5a23
Remove todos
chrisronline 89ef31a
Fix this check
chrisronline 41e55fc
Move kibana alerting over
chrisronline 1226aa0
PR feedback
chrisronline 88f5837
Merge remote-tracking branch 'elastic/master' into np
chrisronline 44c8609
Merge remote-tracking branch 'elastic/master' into np
chrisronline 7e187fd
Use new metrics core service
chrisronline 179469f
Change config for xpack_api_polling_frequency_millis
chrisronline 7f269f0
Make sure this is disabled for now
chrisronline 543e755
Disable both
chrisronline 70292ff
Update this to the new function
chrisronline 2f164b3
Tighten up legacy api needs
chrisronline c1b047a
Check for existence
chrisronline ee8086b
Fix jest tests
chrisronline 708d662
Merge remote-tracking branch 'elastic/master' into np
chrisronline 44738ed
Cleaning up the plugin definition
chrisronline 971e590
Create custom type in our plugin
chrisronline c2b360c
Revert this change
chrisronline 39bdec1
Fix CI issues
chrisronline e4bb754
Merge remote-tracking branch 'elastic/master' into np
chrisronline eb542a0
Add these tests back
chrisronline 2c768c2
Just use a different collector type
chrisronline f5576cb
Merge remote-tracking branch 'elastic/master' into np
chrisronline 863b326
Merge remote-tracking branch 'elastic/master' into np
chrisronline 28e288e
Handle errors better
chrisronline b719600
Merge remote-tracking branch 'elastic/master' into np
chrisronline 0c2818a
Use custom type
chrisronline 7d99bf1
PR feedback
chrisronline 6340e5d
Fix type issues
chrisronline 86a66f4
Merge remote-tracking branch 'elastic/master' into np
chrisronline 492761b
PR feedback
chrisronline File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import { get } from 'lodash'; | ||
| import { resolve } from 'path'; | ||
| import { config } from './config'; | ||
| import { getUiExports } from './ui_exports'; | ||
| import { KIBANA_ALERTING_ENABLED } from './common/constants'; | ||
| import { telemetryCollectionManager } from '../../../../src/legacy/core_plugins/telemetry/server'; | ||
|
|
||
| /** | ||
| * Invokes plugin modules to instantiate the Monitoring plugin for Kibana | ||
| * @param kibana {Object} Kibana plugin instance | ||
| * @return {Object} Monitoring UI Kibana plugin object | ||
| */ | ||
| const deps = ['kibana', 'elasticsearch', 'xpack_main']; | ||
| if (KIBANA_ALERTING_ENABLED) { | ||
| deps.push(...['alerting', 'actions']); | ||
| } | ||
| export const monitoring = kibana => { | ||
| return new kibana.Plugin({ | ||
| require: deps, | ||
| id: 'monitoring', | ||
| configPrefix: 'monitoring', | ||
| publicDir: resolve(__dirname, 'public'), | ||
| init(server) { | ||
| const serverConfig = server.config(); | ||
| const npMonitoring = server.newPlatform.setup.plugins.monitoring; | ||
| if (npMonitoring) { | ||
| const kbnServerStatus = this.kbnServer.status; | ||
| npMonitoring.registerLegacyAPI({ | ||
| telemetryCollectionManager, | ||
| getServerStatus: () => { | ||
| const status = kbnServerStatus.toJSON(); | ||
| return get(status, 'overall.state'); | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
| server.injectUiAppVars('monitoring', () => { | ||
| return { | ||
| maxBucketSize: serverConfig.get('monitoring.ui.max_bucket_size'), | ||
| minIntervalSeconds: serverConfig.get('monitoring.ui.min_interval_seconds'), | ||
| kbnIndex: serverConfig.get('kibana.index'), | ||
| showLicenseExpiration: serverConfig.get('monitoring.ui.show_license_expiration'), | ||
| showCgroupMetricsElasticsearch: serverConfig.get( | ||
| 'monitoring.ui.container.elasticsearch.enabled' | ||
| ), | ||
| showCgroupMetricsLogstash: serverConfig.get('monitoring.ui.container.logstash.enabled'), // Note, not currently used, but see https://github.com/elastic/x-pack-kibana/issues/1559 part 2 | ||
| }; | ||
| }); | ||
| }, | ||
| config, | ||
| uiExports: getUiExports(), | ||
| }); | ||
| }; | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
x-pack/legacy/plugins/monitoring/server/__tests__/check_license.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
x-pack/legacy/plugins/monitoring/server/es_client/__tests__/fixture_read_file.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.