Skip to content

Commit

Permalink
Add maps telemetry saved object in with index: false on all fields. C…
Browse files Browse the repository at this point in the history
…hange dynamic fields to type: object
  • Loading branch information
Aaron Caldwell committed Jun 25, 2020
1 parent e044940 commit 7d5040f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x-pack/plugins/maps/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { getFlightsSavedObjects } from './sample_data/flights_saved_objects.js';
import { getWebLogsSavedObjects } from './sample_data/web_logs_saved_objects.js';
import { registerMapsUsageCollector } from './maps_telemetry/collectors/register';
import { APP_ID, APP_ICON, MAP_SAVED_OBJECT_TYPE, createMapPath } from '../common/constants';
import { mapSavedObjects } from './saved_objects';
import { mapSavedObjects, mapsTelemetrySavedObjects } from './saved_objects';
import { MapsXPackConfig } from '../config';
// @ts-ignore
import { setInternalRepository } from './kibana_server_services';
Expand Down Expand Up @@ -191,6 +191,7 @@ export class MapsPlugin implements Plugin {
},
});

core.savedObjects.registerType(mapsTelemetrySavedObjects);
core.savedObjects.registerType(mapSavedObjects);
registerMapsUsageCollector(usageCollection, currentConfig);

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/maps/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
export { mapsTelemetrySavedObjects } from './maps_telemetry';
export { mapSavedObjects } from './map';
46 changes: 46 additions & 0 deletions x-pack/plugins/maps/server/saved_objects/maps_telemetry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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 { SavedObjectsType } from 'src/core/server';

export const mapsTelemetrySavedObjects: SavedObjectsType = {
name: 'maps-telemetry',
hidden: false,
namespaceType: 'agnostic',
mappings: {
properties: {
settings: {
properties: {
showMapVisualizationTypes: { type: 'boolean', index: false },
},
},
indexPatternsWithGeoFieldCount: { type: 'long', index: false },
indexPatternsWithGeoPointFieldCount: { type: 'long', index: false },
indexPatternsWithGeoShapeFieldCount: { type: 'long', index: false },
mapsTotalCount: { type: 'long', index: false },
timeCaptured: { type: 'date', index: false },
attributesPerMap: {
properties: {
dataSourcesCount: {
properties: {
min: { type: 'long', index: false },
max: { type: 'long', index: false },
avg: { type: 'long', index: false },
},
},
layersCount: {
properties: {
min: { type: 'long', index: false },
max: { type: 'long', index: false },
avg: { type: 'long', index: false },
},
},
layerTypesCount: { type: 'object', index: false },
emsVectorLayersCount: { type: 'object', index: false },
},
},
},
},
};

0 comments on commit 7d5040f

Please sign in to comment.