[Timeseries] remove unused configuration properties (#62543)
* [Timeseries] remove unused configuration properties * Fix PR comments * update id of vis_type_timeseries plugin * metrics -> vis_type_timeseries * fix wrong plugin id * update requiredPliugins for infra/kibana.json * change id * update plugin id in infra folder Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
464a3c23ba
commit
871f7209f9
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"id": "metrics",
|
"id": "visTypeTimeseries",
|
||||||
"version": "8.0.0",
|
"version": "8.0.0",
|
||||||
"kibanaVersion": "kibana",
|
"kibanaVersion": "kibana",
|
||||||
"server": true,
|
"server": true,
|
||||||
|
|
31
src/plugins/vis_type_timeseries/server/config.ts
Normal file
31
src/plugins/vis_type_timeseries/server/config.ts
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
|
* license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright
|
||||||
|
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||||
|
* the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { schema, TypeOf } from '@kbn/config-schema';
|
||||||
|
|
||||||
|
export const config = schema.object({
|
||||||
|
enabled: schema.boolean({ defaultValue: true }),
|
||||||
|
|
||||||
|
/** @deprecated **/
|
||||||
|
chartResolution: schema.number({ defaultValue: 150 }),
|
||||||
|
/** @deprecated **/
|
||||||
|
minimumBucketSize: schema.number({ defaultValue: 10 }),
|
||||||
|
});
|
||||||
|
|
||||||
|
export type VisTypeTimeseriesConfig = TypeOf<typeof config>;
|
|
@ -17,18 +17,25 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { schema, TypeOf } from '@kbn/config-schema';
|
import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server';
|
||||||
import { PluginInitializerContext } from 'src/core/server';
|
import { VisTypeTimeseriesConfig, config as configSchema } from './config';
|
||||||
import { VisTypeTimeseriesPlugin } from './plugin';
|
import { VisTypeTimeseriesPlugin } from './plugin';
|
||||||
|
|
||||||
export { VisTypeTimeseriesSetup, Framework } from './plugin';
|
export { VisTypeTimeseriesSetup, Framework } from './plugin';
|
||||||
|
|
||||||
export const config = {
|
export const config: PluginConfigDescriptor<VisTypeTimeseriesConfig> = {
|
||||||
schema: schema.object({
|
deprecations: ({ unused, renameFromRoot }) => [
|
||||||
enabled: schema.boolean({ defaultValue: true }),
|
// In Kibana v7.8 plugin id was renamed from 'metrics' to 'vis_type_timeseries':
|
||||||
}),
|
renameFromRoot('metrics.enabled', 'vis_type_timeseries.enabled', true),
|
||||||
};
|
renameFromRoot('metrics.chartResolution', 'vis_type_timeseries.chartResolution', true),
|
||||||
|
renameFromRoot('metrics.minimumBucketSize', 'vis_type_timeseries.minimumBucketSize', true),
|
||||||
|
|
||||||
export type VisTypeTimeseriesConfig = TypeOf<typeof config.schema>;
|
// Unused properties which should be removed after releasing Kibana v8.0:
|
||||||
|
unused('chartResolution'),
|
||||||
|
unused('minimumBucketSize'),
|
||||||
|
],
|
||||||
|
schema: configSchema,
|
||||||
|
};
|
||||||
|
|
||||||
export { ValidationTelemetryServiceSetup } from './validation_telemetry';
|
export { ValidationTelemetryServiceSetup } from './validation_telemetry';
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import {
|
||||||
} from 'src/core/server';
|
} from 'src/core/server';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Server } from 'hapi';
|
import { Server } from 'hapi';
|
||||||
import { VisTypeTimeseriesConfig } from '.';
|
import { VisTypeTimeseriesConfig } from './config';
|
||||||
import { getVisData, GetVisData, GetVisDataOptions } from './lib/get_vis_data';
|
import { getVisData, GetVisData, GetVisDataOptions } from './lib/get_vis_data';
|
||||||
import { ValidationTelemetryService } from './validation_telemetry';
|
import { ValidationTelemetryService } from './validation_telemetry';
|
||||||
import { UsageCollectionSetup } from '../../usage_collection/server';
|
import { UsageCollectionSetup } from '../../usage_collection/server';
|
||||||
|
|
|
@ -40,7 +40,7 @@ export function rollup(kibana: any) {
|
||||||
},
|
},
|
||||||
init(server: any) {
|
init(server: any) {
|
||||||
const { core: coreSetup, plugins } = server.newPlatform.setup;
|
const { core: coreSetup, plugins } = server.newPlatform.setup;
|
||||||
const { usageCollection, metrics, indexManagement } = plugins;
|
const { usageCollection, visTypeTimeseries, indexManagement } = plugins;
|
||||||
|
|
||||||
const rollupSetup = (plugins.rollup as unknown) as RollupSetup;
|
const rollupSetup = (plugins.rollup as unknown) as RollupSetup;
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ export function rollup(kibana: any) {
|
||||||
|
|
||||||
rollupPluginInstance.setup(coreSetup, {
|
rollupPluginInstance.setup(coreSetup, {
|
||||||
usageCollection,
|
usageCollection,
|
||||||
metrics,
|
visTypeTimeseries,
|
||||||
indexManagement,
|
indexManagement,
|
||||||
__LEGACY: {
|
__LEGACY: {
|
||||||
plugins: {
|
plugins: {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"requiredPlugins": [
|
"requiredPlugins": [
|
||||||
"home",
|
"home",
|
||||||
"index_management",
|
"index_management",
|
||||||
"metrics",
|
"visTypeTimeseries",
|
||||||
"indexPatternManagement"
|
"indexPatternManagement"
|
||||||
],
|
],
|
||||||
"optionalPlugins": [
|
"optionalPlugins": [
|
||||||
|
|
|
@ -38,12 +38,12 @@ export class RollupsServerPlugin implements Plugin<void, void, any, any> {
|
||||||
{
|
{
|
||||||
__LEGACY: serverShim,
|
__LEGACY: serverShim,
|
||||||
usageCollection,
|
usageCollection,
|
||||||
metrics,
|
visTypeTimeseries,
|
||||||
indexManagement,
|
indexManagement,
|
||||||
}: {
|
}: {
|
||||||
__LEGACY: ServerShim;
|
__LEGACY: ServerShim;
|
||||||
usageCollection?: UsageCollectionSetup;
|
usageCollection?: UsageCollectionSetup;
|
||||||
metrics?: VisTypeTimeseriesSetup;
|
visTypeTimeseries?: VisTypeTimeseriesSetup;
|
||||||
indexManagement?: IndexManagementPluginSetup;
|
indexManagement?: IndexManagementPluginSetup;
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
|
@ -83,8 +83,8 @@ export class RollupsServerPlugin implements Plugin<void, void, any, any> {
|
||||||
indexManagement.indexDataEnricher.add(rollupDataEnricher);
|
indexManagement.indexDataEnricher.add(rollupDataEnricher);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metrics) {
|
if (visTypeTimeseries) {
|
||||||
const { addSearchStrategy } = metrics;
|
const { addSearchStrategy } = visTypeTimeseries;
|
||||||
registerRollupSearchStrategy(routeDependencies, addSearchStrategy);
|
registerRollupSearchStrategy(routeDependencies, addSearchStrategy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"home",
|
"home",
|
||||||
"data",
|
"data",
|
||||||
"dataEnhanced",
|
"dataEnhanced",
|
||||||
"metrics",
|
"visTypeTimeseries",
|
||||||
"alerting",
|
"alerting",
|
||||||
"triggers_actions_ui"
|
"triggers_actions_ui"
|
||||||
],
|
],
|
||||||
|
|
|
@ -20,7 +20,7 @@ export interface InfraServerPluginDeps {
|
||||||
home: HomeServerPluginSetup;
|
home: HomeServerPluginSetup;
|
||||||
spaces: SpacesPluginSetup;
|
spaces: SpacesPluginSetup;
|
||||||
usageCollection: UsageCollectionSetup;
|
usageCollection: UsageCollectionSetup;
|
||||||
metrics: VisTypeTimeseriesSetup;
|
visTypeTimeseries: VisTypeTimeseriesSetup;
|
||||||
features: FeaturesPluginSetup;
|
features: FeaturesPluginSetup;
|
||||||
apm: APMPluginContract;
|
apm: APMPluginContract;
|
||||||
alerting: AlertingPluginContract;
|
alerting: AlertingPluginContract;
|
||||||
|
|
|
@ -245,7 +245,7 @@ export class KibanaFramework {
|
||||||
timerange: { min: number; max: number },
|
timerange: { min: number; max: number },
|
||||||
filters: any[]
|
filters: any[]
|
||||||
): Promise<InfraTSVBResponse> {
|
): Promise<InfraTSVBResponse> {
|
||||||
const { getVisData } = this.plugins.metrics;
|
const { getVisData } = this.plugins.visTypeTimeseries;
|
||||||
if (typeof getVisData !== 'function') {
|
if (typeof getVisData !== 'function') {
|
||||||
throw new Error('TSVB is not available');
|
throw new Error('TSVB is not available');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue