mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* [Telemetry] collect xpack.cloud details (#31180) * collect xpack.cloud details * add elasticsearch cluster uuid * remove cloud ID from telemetry stats * remove esUUID from telemtry stats * add stack_stats.kibana.plugins.cloud.isCloudEnabled
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
/*
|
|
* 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 { getCloudUsageCollector } from './get_cloud_usage_collector';
|
|
|
|
export const cloud = kibana => {
|
|
return new kibana.Plugin({
|
|
id: 'cloud',
|
|
configPrefix: 'xpack.cloud',
|
|
require: ['kibana', 'elasticsearch', 'xpack_main'],
|
|
|
|
uiExports: {
|
|
injectDefaultVars(server, options) {
|
|
return {
|
|
isCloudEnabled: !!options.id,
|
|
cloudId: options.id
|
|
};
|
|
},
|
|
},
|
|
|
|
config(Joi) {
|
|
return Joi.object({
|
|
enabled: Joi.boolean().default(true),
|
|
id: Joi.string(),
|
|
apm: Joi.object({
|
|
url: Joi.string(),
|
|
secret_token: Joi.string(),
|
|
ui: Joi.object({
|
|
url: Joi.string(),
|
|
}).default(),
|
|
}).default(),
|
|
}).default();
|
|
},
|
|
|
|
init(server) {
|
|
const config = server.config().get(`xpack.cloud`);
|
|
server.expose('config', {
|
|
isCloudEnabled: !!config.id
|
|
});
|
|
server.usage.collectorSet.register(getCloudUsageCollector(server));
|
|
}
|
|
});
|
|
};
|