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

[Osquery] Remove osquery-manager-usage-metric SO type #154100

Merged
Merged
Show file tree
Hide file tree
Changes from 6 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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ export const initialExcludeOnUpgradeQueryMock = {
type: 'ml-telemetry',
},
},
{
term: {
type: 'osquery-manager-usage-metric',
},
},
{
term: {
type: 'osquery-usage-metric',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const REMOVED_TYPES: string[] = [
'server',
// https://github.com/elastic/kibana/issues/95617
'tsvb-validation-telemetry',
// Was removed in 8.8 https://github.com/elastic/kibana/issues/223232
Copy link
Contributor

Choose a reason for hiding this comment

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

the url returns 404

'osquery-manager-usage-metric',
// replaced by osquery-manager-usage-metric
'osquery-usage-metric',
// Was removed in 8.1 https://github.com/elastic/kibana/issues/91265
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ describe('createInitialState', () => {
"type": "ml-telemetry",
},
},
Object {
"term": Object {
"type": "osquery-manager-usage-metric",
},
},
Object {
"term": Object {
"type": "osquery-usage-metric",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ describe('checking migration metadata changes on all registered SO types', () =>
"ml-module": "c88b6a012cfb7b7adb7629b1edeab6b83f1fd048",
"ml-trained-model": "49a1685d79990ad05ea1d1d30e28456fe002f3b9",
"monitoring-telemetry": "24f7393dfacb6c7b0f7ad7d242171a1c29feaa48",
"osquery-manager-usage-metric": "23a8f08a98dd0f58ab4e559daa35b06edc40ed4f",
"osquery-pack": "edd84b2c59ef36214ece0676706da8f22175c660",
"osquery-pack-asset": "18e08979d46ee7e5538f54c080aec4d8c58516ca",
"osquery-saved-query": "f5e4e303f65c7607248ea8b2672f1ee30e4fb15e",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"namespace": "2f4316de49999235636386fe51dc06c1",
"namespaces": "2f4316de49999235636386fe51dc06c1",
"originId": "2f4316de49999235636386fe51dc06c1",
"osquery-manager-usage-metric": "4dc4f647d27247c002f56f22742175fe",
"osquery-pack": "37af487fae033ccd92295fd20d1952f0",
"osquery-pack-asset": "989d30eeccb25d62980739dc7790a875",
"osquery-saved-query": "6bf77cfe41a55adb3a00d58e96d72ce9",
Expand Down Expand Up @@ -2482,16 +2481,6 @@
"originId": {
"type": "keyword"
},
"osquery-manager-usage-metric": {
"properties": {
"count": {
"type": "long"
},
"errors": {
"type": "long"
}
}
},
"osquery-pack": {
"properties": {
"created_at": {
Expand Down
5 changes: 0 additions & 5 deletions x-pack/plugins/osquery/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
export const savedQuerySavedObjectType = 'osquery-saved-query';
export const packSavedObjectType = 'osquery-pack';
export const packAssetSavedObjectType = 'osquery-pack-asset';
export const usageMetricSavedObjectType = 'osquery-manager-usage-metric';
export type SavedObjectType =
| 'osquery-saved-query'
| 'osquery-pack'
| 'osquery-manager-usage-metric';

/**
* This makes any optional property the same as Required<T> would but also has the
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/osquery/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"optionalPlugins": [
"fleet",
"home",
"usageCollection",
"lens",
"telemetry",
"cases"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,8 @@ import {
savedQuerySavedObjectType,
packSavedObjectType,
packAssetSavedObjectType,
usageMetricSavedObjectType,
} from '../../../common/types';

export const usageMetricSavedObjectMappings: SavedObjectsType['mappings'] = {
properties: {
count: {
type: 'long',
},
errors: {
type: 'long',
},
},
};

export const usageMetricType: SavedObjectsType = {
name: usageMetricSavedObjectType,
hidden: false,
namespaceType: 'agnostic',
mappings: usageMetricSavedObjectMappings,
};

export const savedQuerySavedObjectMappings: SavedObjectsType['mappings'] = {
dynamic: false,
properties: {
Expand Down
6 changes: 0 additions & 6 deletions x-pack/plugins/osquery/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import type { OsqueryPluginSetup, OsqueryPluginStart, SetupPlugins, StartPlugins
import { defineRoutes } from './routes';
import { osquerySearchStrategyProvider } from './search_strategy/osquery';
import { initSavedObjects } from './saved_objects';
import { initUsageCollectors } from './usage';
import type { OsqueryAppContext } from './lib/osquery_app_context_services';
import { OsqueryAppContextService } from './lib/osquery_app_context_services';
import type { ConfigType } from '../common/config';
Expand Down Expand Up @@ -76,11 +75,6 @@ export class OsqueryPlugin implements Plugin<OsqueryPluginSetup, OsqueryPluginSt
};

initSavedObjects(core.savedObjects);
initUsageCollectors({
core,
osqueryContext,
usageCollection: plugins.usageCollection,
});

core.getStartServices().then(([{ elasticsearch }, depsStart]) => {
const osquerySearchStrategy = osquerySearchStrategyProvider(
Expand Down
8 changes: 0 additions & 8 deletions x-pack/plugins/osquery/server/routes/usage/index.ts

This file was deleted.

121 changes: 0 additions & 121 deletions x-pack/plugins/osquery/server/routes/usage/recorder.test.ts

This file was deleted.

Loading