diff --git a/docs/maps/trouble-shooting.asciidoc b/docs/maps/trouble-shooting.asciidoc index a58e8ac8902b8..60bcabad3a6b4 100644 --- a/docs/maps/trouble-shooting.asciidoc +++ b/docs/maps/trouble-shooting.asciidoc @@ -50,11 +50,4 @@ Increase <> for large index patterns. [float] ==== Custom tiles are not displayed * When using a custom tile service, ensure your tile server has configured https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS[Cross-Origin Resource Sharing (CORS)] so tile requests from your {kib} domain have permission to access your tile server domain. -* Ensure custom vector and tile services have the required coordinate system. Vector data must use EPSG:4326 and tiles must use EPSG:3857. - -[float] -==== Coordinate and region map visualizations not available in New Visualization menu - -Kibana’s out-of-the-box settings no longer offers coordinate and region maps as a -choice in the New Visualization menu because you can create these maps in the Maps app. -If you want to create new coordinate and region map visualizations, set `xpack.maps.showMapVisualizationTypes` to `true`. +* Ensure custom vector and tile services have the required coordinate system. Vector data must use EPSG:4326 and tiles must use EPSG:3857. \ No newline at end of file diff --git a/packages/kbn-telemetry-tools/src/tools/__fixture__/all_extracted_collectors.ts b/packages/kbn-telemetry-tools/src/tools/__fixture__/all_extracted_collectors.ts index 1f74a2a02eb1e..a3362f1a25ea8 100644 --- a/packages/kbn-telemetry-tools/src/tools/__fixture__/all_extracted_collectors.ts +++ b/packages/kbn-telemetry-tools/src/tools/__fixture__/all_extracted_collectors.ts @@ -17,6 +17,7 @@ import { parsedWorkingCollector } from './parsed_working_collector'; import { parsedCollectorWithDescription } from './parsed_working_collector_with_description'; import { parsedStatsCollector } from './parsed_stats_collector'; import { parsedImportedInterfaceFromExport } from './parsed_imported_interface_from_export'; +import { parsedEnumCollector } from './parsed_enum_collector'; export const allExtractedCollectors: ParsedUsageCollection[] = [ ...parsedExternallyDefinedCollector, @@ -29,4 +30,5 @@ export const allExtractedCollectors: ParsedUsageCollection[] = [ ...parsedStatsCollector, parsedCollectorWithDescription, parsedWorkingCollector, + parsedEnumCollector, ]; diff --git a/packages/kbn-telemetry-tools/src/tools/__fixture__/mock_schema.json b/packages/kbn-telemetry-tools/src/tools/__fixture__/mock_schema.json index a385cd6798365..fb66a802de108 100644 --- a/packages/kbn-telemetry-tools/src/tools/__fixture__/mock_schema.json +++ b/packages/kbn-telemetry-tools/src/tools/__fixture__/mock_schema.json @@ -5,6 +5,20 @@ "flat": { "type": "keyword" }, + "interface_terms": { + "properties": { + "computed_term": { + "properties": { + "total": { + "type": "long" + }, + "type": { + "type": "boolean" + } + } + } + } + }, "my_index_signature_prop": { "properties": { "avg": { diff --git a/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_enum_collector.ts b/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_enum_collector.ts new file mode 100644 index 0000000000000..db2f239006446 --- /dev/null +++ b/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_enum_collector.ts @@ -0,0 +1,118 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { SyntaxKind } from 'typescript'; +import { ParsedUsageCollection } from '../ts_parser'; + +export const parsedEnumCollector: ParsedUsageCollection = [ + 'src/fixtures/telemetry_collectors/enum_collector.ts', + { + collectorName: 'my_enum_collector', + fetch: { + typeName: 'Usage', + typeDescriptor: { + layerTypes: { + es_docs: { + min: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + max: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + total: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + avg: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + }, + es_top_hits: { + min: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + max: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + total: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + avg: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + }, + }, + }, + }, + schema: { + value: { + layerTypes: { + es_top_hits: { + min: { + type: 'long', + _meta: { + description: 'min number of es top hits layers per map', + }, + }, + max: { + type: 'long', + _meta: { + description: 'max number of es top hits layers per map', + }, + }, + avg: { + type: 'float', + _meta: { + description: 'avg number of es top hits layers per map', + }, + }, + total: { + type: 'long', + _meta: { + description: 'total number of es top hits layers in cluster', + }, + }, + }, + es_docs: { + min: { + type: 'long', + _meta: { + description: 'min number of es document layers per map', + }, + }, + max: { + type: 'long', + _meta: { + description: 'max number of es document layers per map', + }, + }, + avg: { + type: 'float', + _meta: { + description: 'avg number of es document layers per map', + }, + }, + total: { + type: 'long', + _meta: { + description: 'total number of es document layers in cluster', + }, + }, + }, + }, + }, + }, + }, +]; diff --git a/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_working_collector.ts b/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_working_collector.ts index c7aebb0ff27e5..81ef1d32b4ff1 100644 --- a/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_working_collector.ts +++ b/packages/kbn-telemetry-tools/src/tools/__fixture__/parsed_working_collector.ts @@ -15,6 +15,12 @@ export const parsedWorkingCollector: ParsedUsageCollection = [ collectorName: 'my_working_collector', schema: { value: { + interface_terms: { + computed_term: { + total: { type: 'long' }, + type: { type: 'boolean' }, + }, + }, flat: { type: 'keyword', }, @@ -100,6 +106,18 @@ export const parsedWorkingCollector: ParsedUsageCollection = [ type: 'StringKeyword', }, }, + interface_terms: { + computed_term: { + total: { + kind: SyntaxKind.NumberKeyword, + type: 'NumberKeyword', + }, + type: { + kind: SyntaxKind.BooleanKeyword, + type: 'BooleanKeyword', + }, + }, + }, }, }, }, diff --git a/packages/kbn-telemetry-tools/src/tools/extract_collectors.test.ts b/packages/kbn-telemetry-tools/src/tools/extract_collectors.test.ts index 5eee06a5182ee..87ca1f2e173b2 100644 --- a/packages/kbn-telemetry-tools/src/tools/extract_collectors.test.ts +++ b/packages/kbn-telemetry-tools/src/tools/extract_collectors.test.ts @@ -22,9 +22,21 @@ describe('extractCollectors', () => { const configs = await parseTelemetryRC(configRoot); expect(configs).toHaveLength(1); const programPaths = await getProgramPaths(configs[0]); - const results = [...extractCollectors(programPaths, tsConfig)]; - expect(results).toHaveLength(11); - expect(results).toStrictEqual(allExtractedCollectors); + expect(results).toHaveLength(12); + + // loop over results for better error messages on failure: + for (const result of results) { + const [resultPath, resultCollectorDetails] = result; + const matchingCollector = allExtractedCollectors.find( + ([, extractorCollectorDetails]) => + extractorCollectorDetails.collectorName === resultCollectorDetails.collectorName + ); + if (!matchingCollector) { + throw new Error(`Unable to find matching collector in ${resultPath}`); + } + + expect(result).toStrictEqual(matchingCollector); + } }); }); diff --git a/packages/kbn-telemetry-tools/src/tools/serializer.ts b/packages/kbn-telemetry-tools/src/tools/serializer.ts index 9bde3cb839364..7dbd5288737ed 100644 --- a/packages/kbn-telemetry-tools/src/tools/serializer.ts +++ b/packages/kbn-telemetry-tools/src/tools/serializer.ts @@ -82,6 +82,7 @@ export function getConstraints(node: ts.Node, program: ts.Program): any { return getConstraints(node.type, program); } + // node input ('a' | 'b'). returns ['a', 'b']; if (ts.isUnionTypeNode(node)) { const types = node.types.filter(discardNullOrUndefined); return types.reduce((acc, typeNode) => { @@ -95,6 +96,10 @@ export function getConstraints(node: ts.Node, program: ts.Program): any { return node.literal.text; } + if (ts.isStringLiteral(node)) { + return node.text; + } + if (ts.isImportSpecifier(node)) { const source = node.getSourceFile(); const importedModuleName = getModuleSpecifier(node); @@ -104,6 +109,24 @@ export function getConstraints(node: ts.Node, program: ts.Program): any { return getConstraints(declarationNode, program); } + // node input ( enum { A = 'my_a', B = 'my_b' } ). returns ['my_a', 'my_b']; + if (ts.isEnumDeclaration(node)) { + return node.members.map((member) => getConstraints(member, program)); + } + + // node input ( 'A = my_a' ) + if (ts.isEnumMember(node)) { + const { initializer } = node; + if (!initializer) { + // no initializer ( enum { A } ); + const memberName = node.getText(); + throw Error( + `EnumMember (${memberName}) must have an initializer. Example: (enum { ${memberName} = '${memberName}' })` + ); + } + + return getConstraints(initializer, program); + } throw Error(`Unsupported constraint of kind ${node.kind} [${ts.SyntaxKind[node.kind]}]`); } @@ -113,22 +136,41 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor | return getDescriptor(node.type, program); } } + + /** + * Supported interface keys: + * inteface T { [computed_value]: ANY_VALUE }; + * inteface T { hardcoded_string: ANY_VALUE }; + */ if (ts.isTypeLiteralNode(node) || ts.isInterfaceDeclaration(node)) { return node.members.reduce((acc, m) => { - const key = m.name?.getText(); - if (key) { - return { ...acc, [key]: getDescriptor(m, program) }; - } else { - return { ...acc, ...getDescriptor(m, program) }; + const { name: nameNode } = m; + if (nameNode) { + const nodeText = nameNode.getText(); + if (ts.isComputedPropertyName(nameNode)) { + const typeChecker = program.getTypeChecker(); + const symbol = typeChecker.getSymbolAtLocation(nameNode); + const key = symbol?.getName(); + if (!key) { + throw Error(`Unable to parse computed value of ${nodeText}.`); + } + return { ...acc, [key]: getDescriptor(m, program) }; + } + + return { ...acc, [nodeText]: getDescriptor(m, program) }; } + + return { ...acc, ...getDescriptor(m, program) }; }, {}); } - // If it's defined as signature { [key: string]: OtherInterface } + /** + * Supported signature constraints of `string`: + * { [key in 'prop1' | 'prop2']: value } + * { [key in Enum]: value } + */ if ((ts.isIndexSignatureDeclaration(node) || ts.isMappedTypeNode(node)) && node.type) { const descriptor = getDescriptor(node.type, program); - - // If we know the constraints of `string` ({ [key in 'prop1' | 'prop2']: value }) const constraint = (node as ts.MappedTypeNode).typeParameter?.constraint; if (constraint) { const constraints = getConstraints(constraint, program); diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index e2d81c5ae1752..c883e0b68114e 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -293,7 +293,6 @@ kibana_vars=( xpack.ingestManager.registryUrl xpack.license_management.enabled xpack.maps.enabled - xpack.maps.showMapVisualizationTypes xpack.ml.enabled xpack.observability.annotations.index xpack.observability.unsafe.alertingExperience.enabled diff --git a/src/fixtures/telemetry_collectors/enum_collector.ts b/src/fixtures/telemetry_collectors/enum_collector.ts new file mode 100644 index 0000000000000..b1e7d232ee766 --- /dev/null +++ b/src/fixtures/telemetry_collectors/enum_collector.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CollectorSet } from '../../plugins/usage_collection/server/collector'; +import { loggerMock } from '../../core/server/logging/logger.mock'; + +const { makeUsageCollector } = new CollectorSet({ + logger: loggerMock.create(), + maximumWaitTimeForAllCollectorsInS: 0, +}); + +enum TELEMETRY_LAYER_TYPE { + ES_DOCS = 'es_docs', + ES_TOP_HITS = 'es_top_hits', +} + +interface ClusterCountStats { + min: number; + max: number; + total: number; + avg: number; +} + +type TELEMETRY_LAYER_TYPE_COUNTS_PER_CLUSTER = { + [key in TELEMETRY_LAYER_TYPE]?: ClusterCountStats; +}; + +interface Usage { + layerTypes: TELEMETRY_LAYER_TYPE_COUNTS_PER_CLUSTER; +} + +export const myCollector = makeUsageCollector({ + type: 'my_enum_collector', + isReady: () => true, + fetch() { + return { + layerTypes: { + es_docs: { + avg: 1, + max: 2, + min: 0, + total: 2, + }, + }, + }; + }, + schema: { + layerTypes: { + es_top_hits: { + min: { type: 'long', _meta: { description: 'min number of es top hits layers per map' } }, + max: { type: 'long', _meta: { description: 'max number of es top hits layers per map' } }, + avg: { + type: 'float', + _meta: { description: 'avg number of es top hits layers per map' }, + }, + total: { + type: 'long', + _meta: { description: 'total number of es top hits layers in cluster' }, + }, + }, + es_docs: { + min: { type: 'long', _meta: { description: 'min number of es document layers per map' } }, + max: { type: 'long', _meta: { description: 'max number of es document layers per map' } }, + avg: { + type: 'float', + _meta: { description: 'avg number of es document layers per map' }, + }, + total: { + type: 'long', + _meta: { description: 'total number of es document layers in cluster' }, + }, + }, + }, + }, +}); diff --git a/src/fixtures/telemetry_collectors/working_collector.ts b/src/fixtures/telemetry_collectors/working_collector.ts index 22a7f3f5be4c9..ab9d6d56af05a 100644 --- a/src/fixtures/telemetry_collectors/working_collector.ts +++ b/src/fixtures/telemetry_collectors/working_collector.ts @@ -18,13 +18,17 @@ interface MyObject { total: number; type: boolean; } - +const COMPUTED_TERM = 'computed_term'; +export interface CONSTANT_TERM_INTERFACE { + [COMPUTED_TERM]?: MyObject; +} interface Usage { flat?: string; my_str?: string; my_objects: MyObject; my_array?: MyObject[]; my_str_array?: string[]; + interface_terms?: CONSTANT_TERM_INTERFACE; my_index_signature_prop?: { [key: string]: number; }; @@ -89,6 +93,12 @@ export const myCollector = makeUsageCollector({ }, }, my_str_array: { type: 'array', items: { type: 'keyword' } }, + interface_terms: { + computed_term: { + total: { type: 'long' }, + type: { type: 'boolean' }, + }, + }, my_index_signature_prop: { count: { type: 'long' }, avg: { type: 'float' }, diff --git a/test/functional/apps/visualize/_chart_types.ts b/test/functional/apps/visualize/_chart_types.ts index f52d8f00c1e48..1afc372f75b0e 100644 --- a/test/functional/apps/visualize/_chart_types.ts +++ b/test/functional/apps/visualize/_chart_types.ts @@ -35,7 +35,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.clickAggBasedVisualizations(); const expectedChartTypes = [ 'Area', - 'Coordinate Map', 'Data table', 'Gauge', 'Goal', @@ -44,7 +43,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Line', 'Metric', 'Pie', - 'Region Map', 'Tag cloud', 'Timelion', 'Vertical bar', diff --git a/test/functional/config.js b/test/functional/config.js index 19a628be10f52..32688ca9c7f8f 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -43,7 +43,6 @@ export default async function ({ readConfigFile }) { ...commonConfig.get('kbnTestServer.serverArgs'), '--telemetry.optIn=false', '--savedObjects.maxImportPayloadBytes=10485760', - '--xpack.maps.showMapVisualizationTypes=true', // to be re-enabled once kibana/issues/102552 is completed '--xpack.security.enabled=false', diff --git a/x-pack/plugins/maps/config.ts b/x-pack/plugins/maps/config.ts index 104ba00263545..3dcae8f94e844 100644 --- a/x-pack/plugins/maps/config.ts +++ b/x-pack/plugins/maps/config.ts @@ -9,14 +9,12 @@ import { schema, TypeOf } from '@kbn/config-schema'; export interface MapsConfigType { enabled: boolean; - showMapVisualizationTypes: boolean; showMapsInspectorAdapter: boolean; preserveDrawingBuffer: boolean; } export const configSchema = schema.object({ enabled: schema.boolean({ defaultValue: true }), - showMapVisualizationTypes: schema.boolean({ defaultValue: false }), // flag used in functional testing showMapsInspectorAdapter: schema.boolean({ defaultValue: false }), // flag used in functional testing diff --git a/x-pack/plugins/maps/public/maps_vis_type_alias.ts b/x-pack/plugins/maps/public/maps_vis_type_alias.ts index 194b4595c0c93..9bab4992d1582 100644 --- a/x-pack/plugins/maps/public/maps_vis_type_alias.ts +++ b/x-pack/plugins/maps/public/maps_vis_type_alias.ts @@ -21,13 +21,8 @@ import { MAP_SAVED_OBJECT_TYPE, } from '../common/constants'; -export function getMapsVisTypeAlias( - visualizations: VisualizationsSetup, - showMapVisualizationTypes: boolean -) { - if (!showMapVisualizationTypes) { - visualizations.hideTypes(['region_map', 'tile_map']); - } +export function getMapsVisTypeAlias(visualizations: VisualizationsSetup) { + visualizations.hideTypes(['region_map', 'tile_map']); const appDescription = i18n.translate('xpack.maps.visTypeAlias.description', { defaultMessage: 'Create and style maps with multiple layers and indices.', diff --git a/x-pack/plugins/maps/public/plugin.ts b/x-pack/plugins/maps/public/plugin.ts index 4ee2a83589c95..ae72c26ae7144 100644 --- a/x-pack/plugins/maps/public/plugin.ts +++ b/x-pack/plugins/maps/public/plugin.ts @@ -168,9 +168,7 @@ export class MapsPlugin if (plugins.home) { plugins.home.featureCatalogue.register(featureCatalogueEntry); } - plugins.visualizations.registerAlias( - getMapsVisTypeAlias(plugins.visualizations, config.showMapVisualizationTypes) - ); + plugins.visualizations.registerAlias(getMapsVisTypeAlias(plugins.visualizations)); plugins.embeddable.registerEmbeddableFactory(MAP_SAVED_OBJECT_TYPE, new MapEmbeddableFactory()); core.application.register({ diff --git a/x-pack/plugins/maps/server/index.ts b/x-pack/plugins/maps/server/index.ts index a884b2354b583..6f0b9b39c40dc 100644 --- a/x-pack/plugins/maps/server/index.ts +++ b/x-pack/plugins/maps/server/index.ts @@ -18,36 +18,11 @@ export const config: PluginConfigDescriptor = { // the value `true` in this context signals configuration is exposed to browser exposeToBrowser: { enabled: true, - showMapVisualizationTypes: true, showMapsInspectorAdapter: true, preserveDrawingBuffer: true, }, schema: configSchema, deprecations: () => [ - ( - completeConfig: Record, - rootPath: string, - addDeprecation: AddConfigDeprecation - ) => { - if (_.get(completeConfig, 'xpack.maps.showMapVisualizationTypes') === undefined) { - return completeConfig; - } - addDeprecation({ - message: i18n.translate('xpack.maps.deprecation.showMapVisualizationTypes.message', { - defaultMessage: - 'xpack.maps.showMapVisualizationTypes is deprecated and is no longer used', - }), - correctiveActions: { - manualSteps: [ - i18n.translate('xpack.maps.deprecation.showMapVisualizationTypes.step1', { - defaultMessage: - 'Remove "xpack.maps.showMapVisualizationTypes" in the Kibana config file, CLI flag, or environment variable (in Docker only).', - }), - ], - }, - }); - return completeConfig; - }, ( completeConfig: Record, rootPath: string, diff --git a/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts b/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts index d6bd87a39eeee..ee2b81716ca6a 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts @@ -7,12 +7,8 @@ import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { getMapsTelemetry, MapsUsage } from '../maps_telemetry'; -import { MapsConfigType } from '../../../config'; -export function registerMapsUsageCollector( - usageCollection: UsageCollectionSetup, - config: MapsConfigType -): void { +export function registerMapsUsageCollector(usageCollection: UsageCollectionSetup): void { if (!usageCollection) { return; } @@ -20,11 +16,8 @@ export function registerMapsUsageCollector( const mapsUsageCollector = usageCollection.makeUsageCollector({ type: 'maps', isReady: () => true, - fetch: async () => await getMapsTelemetry(config), + fetch: async () => await getMapsTelemetry(), schema: { - settings: { - showMapVisualizationTypes: { type: 'boolean' }, - }, indexPatternsWithGeoFieldCount: { type: 'long' }, indexPatternsWithGeoPointFieldCount: { type: 'long' }, indexPatternsWithGeoShapeFieldCount: { type: 'long' }, diff --git a/x-pack/plugins/maps/server/maps_telemetry/collectors/register_collector.test.js b/x-pack/plugins/maps/server/maps_telemetry/collectors/register_collector.test.js index c58e4d90408b5..f317025bad3c2 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/collectors/register_collector.test.js +++ b/x-pack/plugins/maps/server/maps_telemetry/collectors/register_collector.test.js @@ -9,16 +9,12 @@ import { registerMapsUsageCollector } from './register'; describe('buildCollectorObj#fetch', () => { let makeUsageCollectorStub; - let savedObjectsClient; let registerStub; let usageCollection; - let config; beforeEach(() => { makeUsageCollectorStub = jest.fn(); - savedObjectsClient = jest.fn(); registerStub = jest.fn(); - config = jest.fn(); usageCollection = { makeUsageCollector: makeUsageCollectorStub, registerCollector: registerStub, @@ -26,7 +22,7 @@ describe('buildCollectorObj#fetch', () => { }); test('makes and registers maps usage collector', async () => { - registerMapsUsageCollector(usageCollection, savedObjectsClient, config); + registerMapsUsageCollector(usageCollection); expect(registerStub).toHaveBeenCalledTimes(1); expect(makeUsageCollectorStub).toHaveBeenCalledTimes(1); diff --git a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts index 46457265e977e..b345c427b50b9 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts @@ -23,7 +23,6 @@ import { } from '../../common/descriptor_types'; import { MapSavedObject, MapSavedObjectAttributes } from '../../common/map_saved_object_type'; import { getIndexPatternsService, getInternalRepository } from '../kibana_server_services'; -import { MapsConfigType } from '../../config'; import { injectReferences } from '././../../common/migrations/references'; import { getBaseMapsPerCluster, @@ -38,10 +37,6 @@ import { TELEMETRY_TERM_JOIN_COUNTS_PER_CLUSTER, } from './util'; -interface Settings { - showMapVisualizationTypes: boolean; -} - interface IStats { [key: string]: { min: number; @@ -85,9 +80,7 @@ export interface LayersStatsUsage { }; } -export interface MapsUsage extends LayersStatsUsage, GeoIndexPatternsUsage { - settings: Settings; -} +export type MapsUsage = LayersStatsUsage & GeoIndexPatternsUsage; function getUniqueLayerCounts(layerCountsList: ILayerTypeCount[], mapsCount: number) { const uniqueLayerTypes = _.uniq(_.flatten(layerCountsList.map((lTypes) => Object.keys(lTypes)))); @@ -327,7 +320,7 @@ export async function execTransformOverMultipleSavedObjectPages( } while (page * perPage < total); } -export async function getMapsTelemetry(config: MapsConfigType): Promise { +export async function getMapsTelemetry(): Promise { // Get layer descriptors for Maps saved objects. This is not set up // to be done incrementally (i.e. - per page) but minimally we at least // build a list of small footprint objects @@ -350,9 +343,6 @@ export async function getMapsTelemetry(config: MapsConfigType): Promise