Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maps] Add maps telemetry saved object in with mappings disabled #69995

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, getExistingMapPath } 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';
23 changes: 23 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,23 @@
/*
* 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';

/*
* The maps-telemetry saved object type isn't used, but in order to remove these fields from
* the mappings we register this type with `type: 'object', enabled: true` to remove all
* previous fields from the mappings until https://github.com/elastic/kibana/issues/67086 is
* solved.
*/
export const mapsTelemetrySavedObjects: SavedObjectsType = {
name: 'maps-telemetry',
hidden: false,
namespaceType: 'agnostic',
mappings: {
// @ts-ignore Core types don't support this since it's only really valid when removing a previously registered type
type: 'object',
enabled: false,
},
};