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] Remove maps-telemetry saved object as it is no longer in use #69871

Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 0 additions & 1 deletion x-pack/plugins/maps/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const EMS_TILES_VECTOR_TILE_PATH = 'vector/tile';
export const MAP_SAVED_OBJECT_TYPE = 'map';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this constant needs to match the name in x-pack/plugins/maps/server/saved_objects/maps_telemetry.ts: maps-telemetry. Because we are searching for it in the getMapsTelemetry method :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold on! Scratch that! Is this related to some other saved objects maps is maintaining?

Copy link
Contributor Author

@kindsun kindsun Jun 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, looks like you figured this out in the above conversation but this is unrelated. This defines the constant for our saved maps of type map.

export const APP_ID = 'maps';
export const APP_ICON = 'gisApp';
export const TELEMETRY_TYPE = APP_ID;

export const MAP_APP_PATH = `app/${APP_ID}`;
export const GIS_API_PATH = `api/${APP_ID}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { getMapsTelemetry } from '../maps_telemetry';
// @ts-ignore
import { TELEMETRY_TYPE } from '../../../common/constants';
import { MapsConfigType } from '../../../config';

export function registerMapsUsageCollector(
Expand All @@ -19,7 +17,7 @@ export function registerMapsUsageCollector(
}

const mapsUsageCollector = usageCollection.makeUsageCollector({
type: TELEMETRY_TYPE,
type: 'maps',
isReady: () => true,
fetch: async () => await getMapsTelemetry(config),
});
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/maps/server/saved_objects/maps_telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { SavedObjectsType } from 'src/core/server';

export const mapsTelemetrySavedObjects: SavedObjectsType = {
name: 'maps',
name: 'maps-telemetry',
hidden: false,
namespaceType: 'agnostic',
mappings: {
Expand Down Expand Up @@ -37,8 +37,8 @@ export const mapsTelemetrySavedObjects: SavedObjectsType = {
avg: { type: 'long' },
},
},
layerTypesCount: { dynamic: 'true', properties: {} },
emsVectorLayersCount: { dynamic: 'true', properties: {} },
Comment on lines -40 to -41
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be enough if we did layerTypesCount: { type: 'object' }? That would allow us storing the object but not indexing each value in it (since we are not actually searching/aggregating for those values)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might make more sense here as a placeholder since we do want to retain some version of these moving forward but without using dynamic fields. I've added back in the logic supporting construction of these fields and changed their types per your recommendation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also need to set enabled: false to prevent these from being indexed. If we're not querying this telemetry data from Kibana, can we just set the entire maps-telemetry mapping to type: 'object', enabled: false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rudolf Per the conversation above, I've actually removed this saved object. It appears to be leftover from older logic and is no longer required!

layerTypesCount: { type: 'object' },
emsVectorLayersCount: { type: 'object' },
},
},
},
Expand Down