forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7.x] [Monitoring] Migrate server to NP (elastic#56675) (elastic#60796)
* Backport 3a39602 * Remove unused code
- Loading branch information
1 parent
f1965eb
commit 8d9f39b
Showing
388 changed files
with
2,281 additions
and
2,356 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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.