From 802af7e5ff51ecbfe9df9306281816527b787e0c Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Fri, 12 Mar 2021 09:47:12 -0800 Subject: [PATCH] [Rename] kibana-usage-collection plugin (#162) Signed-off-by: Kawika Avilla --- .../server/__snapshots__/index.test.ts.snap | 15 ------------ .../README.md | 4 ++-- .../common/constants.ts | 8 +++---- .../opensearch_dashboards.json} | 4 ++-- .../server/__snapshots__/index.test.ts.snap | 15 ++++++++++++ .../collectors/application_usage/README.md | 4 ++-- .../collectors/application_usage/index.ts | 0 .../application_usage/rollups.test.ts | 0 .../collectors/application_usage/rollups.ts | 4 ++-- .../application_usage/saved_objects_types.ts | 2 +- .../collectors/application_usage/schema.ts | 2 +- ...emetry_application_usage_collector.test.ts | 4 ++-- .../telemetry_application_usage_collector.ts | 2 +- .../collectors/core/core_usage_collector.ts | 2 +- .../server/collectors/core/index.test.ts | 0 .../server/collectors/core/index.ts | 0 .../collectors/csp/csp_collector.test.ts | 0 .../server/collectors/csp/csp_collector.ts | 0 .../server/collectors/csp/index.ts | 0 .../server/collectors/index.ts | 2 +- .../__snapshots__/index.test.ts.snap | 0 .../collectors/management/index.test.ts | 0 .../server/collectors/management/index.ts | 0 .../server/collectors/management/schema.ts | 2 +- .../telemetry_management_collector.ts | 2 +- .../get_saved_object_counts.test.ts | 4 ++-- .../get_saved_object_counts.ts | 16 ++++++------- .../opensearch_dashboards}/index.test.ts | 14 +++++------ .../opensearch_dashboards}/index.ts | 2 +- .../opensearch_dashboards_usage_collector.ts} | 24 +++++++++---------- .../__snapshots__/index.test.ts.snap | 0 .../server/collectors/ops_stats/index.test.ts | 2 +- .../server/collectors/ops_stats/index.ts | 0 .../ops_stats/ops_stats_collector.ts | 8 +++---- .../server/collectors/ui_metric/index.test.ts | 4 ++-- .../server/collectors/ui_metric/index.ts | 0 .../server/collectors/ui_metric/schema.ts | 6 ++--- .../telemetry_ui_metric_collector.ts | 2 +- .../server/index.test.ts | 2 +- .../server/index.ts | 6 ++--- .../server/plugin.ts | 10 ++++---- 41 files changed, 86 insertions(+), 86 deletions(-) delete mode 100644 src/plugins/kibana_usage_collection/server/__snapshots__/index.test.ts.snap rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/README.md (62%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/common/constants.ts (72%) rename src/plugins/{kibana_usage_collection/kibana.json => opensearch_dashboards_usage_collection/opensearch_dashboards.json} (56%) create mode 100644 src/plugins/opensearch_dashboards_usage_collection/server/__snapshots__/index.test.ts.snap rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/application_usage/README.md (81%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/application_usage/index.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/application_usage/rollups.test.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/application_usage/rollups.ts (97%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/application_usage/saved_objects_types.ts (98%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/application_usage/schema.ts (97%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/application_usage/telemetry_application_usage_collector.test.ts (98%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/application_usage/telemetry_application_usage_collector.ts (99%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/core/core_usage_collector.ts (99%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/core/index.test.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/core/index.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/csp/csp_collector.test.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/csp/csp_collector.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/csp/index.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/index.ts (93%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/management/__snapshots__/index.test.ts.snap (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/management/index.test.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/management/index.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/management/schema.ts (97%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/management/telemetry_management_collector.ts (97%) rename src/plugins/{kibana_usage_collection/server/collectors/kibana => opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards}/get_saved_object_counts.test.ts (97%) rename src/plugins/{kibana_usage_collection/server/collectors/kibana => opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards}/get_saved_object_counts.ts (78%) rename src/plugins/{kibana_usage_collection/server/collectors/kibana => opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards}/index.test.ts (85%) rename src/plugins/{kibana_usage_collection/server/collectors/kibana => opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards}/index.ts (88%) rename src/plugins/{kibana_usage_collection/server/collectors/kibana/kibana_usage_collector.ts => opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/opensearch_dashboards_usage_collector.ts} (70%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/ops_stats/__snapshots__/index.test.ts.snap (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/ops_stats/index.test.ts (98%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/ops_stats/index.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/ops_stats/ops_stats_collector.ts (90%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/ui_metric/index.test.ts (95%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/ui_metric/index.ts (100%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/ui_metric/schema.ts (93%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/collectors/ui_metric/telemetry_ui_metric_collector.ts (98%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/index.test.ts (97%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/index.ts (82%) rename src/plugins/{kibana_usage_collection => opensearch_dashboards_usage_collection}/server/plugin.ts (90%) diff --git a/src/plugins/kibana_usage_collection/server/__snapshots__/index.test.ts.snap b/src/plugins/kibana_usage_collection/server/__snapshots__/index.test.ts.snap deleted file mode 100644 index c4795627955..00000000000 --- a/src/plugins/kibana_usage_collection/server/__snapshots__/index.test.ts.snap +++ /dev/null @@ -1,15 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`kibana_usage_collection Runs the setup method without issues 1`] = `false`; - -exports[`kibana_usage_collection Runs the setup method without issues 2`] = `true`; - -exports[`kibana_usage_collection Runs the setup method without issues 3`] = `false`; - -exports[`kibana_usage_collection Runs the setup method without issues 4`] = `false`; - -exports[`kibana_usage_collection Runs the setup method without issues 5`] = `false`; - -exports[`kibana_usage_collection Runs the setup method without issues 6`] = `true`; - -exports[`kibana_usage_collection Runs the setup method without issues 7`] = `false`; diff --git a/src/plugins/kibana_usage_collection/README.md b/src/plugins/opensearch_dashboards_usage_collection/README.md similarity index 62% rename from src/plugins/kibana_usage_collection/README.md rename to src/plugins/opensearch_dashboards_usage_collection/README.md index 69711d30cdc..17f27d0c2be 100644 --- a/src/plugins/kibana_usage_collection/README.md +++ b/src/plugins/opensearch_dashboards_usage_collection/README.md @@ -1,6 +1,6 @@ -# Kibana Usage Collection +# OpenSearch Dashboards Usage Collection -This plugin registers the basic usage collectors from Kibana: +This plugin registers the basic usage collectors from OpenSearch Dashboards: - [Application Usage](./server/collectors/application_usage/README.md) - UI Metrics diff --git a/src/plugins/kibana_usage_collection/common/constants.ts b/src/plugins/opensearch_dashboards_usage_collection/common/constants.ts similarity index 72% rename from src/plugins/kibana_usage_collection/common/constants.ts rename to src/plugins/opensearch_dashboards_usage_collection/common/constants.ts index c4e7eaac51c..9f93cc7552d 100644 --- a/src/plugins/kibana_usage_collection/common/constants.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/common/constants.ts @@ -17,10 +17,10 @@ * under the License. */ -export const PLUGIN_ID = 'kibanaUsageCollection'; -export const PLUGIN_NAME = 'kibana_usage_collection'; +export const PLUGIN_ID = 'opensearchDashboardsUsageCollection'; +export const PLUGIN_NAME = 'opensearch_dashboards_usage_collection'; /** - * The type name used to publish Kibana usage stats in the formatted as bulk. + * The type name used to publish OpenSearch Dashboards usage stats in the formatted as bulk. */ -export const KIBANA_STATS_TYPE = 'kibana_stats'; +export const OPENSEARCH_DASHBOARDS_STATS_TYPE = 'opensearch_dashboards_stats'; diff --git a/src/plugins/kibana_usage_collection/kibana.json b/src/plugins/opensearch_dashboards_usage_collection/opensearch_dashboards.json similarity index 56% rename from src/plugins/kibana_usage_collection/kibana.json rename to src/plugins/opensearch_dashboards_usage_collection/opensearch_dashboards.json index 87d83ebecde..405f79097b0 100644 --- a/src/plugins/kibana_usage_collection/kibana.json +++ b/src/plugins/opensearch_dashboards_usage_collection/opensearch_dashboards.json @@ -1,6 +1,6 @@ { - "id": "kibanaUsageCollection", - "version": "kibana", + "id": "opensearchDashboardsUsageCollection", + "version": "opensearchDashboards", "server": true, "ui": false, "requiredPlugins": [ diff --git a/src/plugins/opensearch_dashboards_usage_collection/server/__snapshots__/index.test.ts.snap b/src/plugins/opensearch_dashboards_usage_collection/server/__snapshots__/index.test.ts.snap new file mode 100644 index 00000000000..458f7ffae43 --- /dev/null +++ b/src/plugins/opensearch_dashboards_usage_collection/server/__snapshots__/index.test.ts.snap @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`opensearch_dashboards_usage_collection Runs the setup method without issues 1`] = `false`; + +exports[`opensearch_dashboards_usage_collection Runs the setup method without issues 2`] = `true`; + +exports[`opensearch_dashboards_usage_collection Runs the setup method without issues 3`] = `false`; + +exports[`opensearch_dashboards_usage_collection Runs the setup method without issues 4`] = `false`; + +exports[`opensearch_dashboards_usage_collection Runs the setup method without issues 5`] = `false`; + +exports[`opensearch_dashboards_usage_collection Runs the setup method without issues 6`] = `true`; + +exports[`opensearch_dashboards_usage_collection Runs the setup method without issues 7`] = `false`; diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/README.md b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/README.md similarity index 81% rename from src/plugins/kibana_usage_collection/server/collectors/application_usage/README.md rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/README.md index cb80538fd17..c8cfd9fb025 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/README.md +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/README.md @@ -1,6 +1,6 @@ # Application Usage -This collector reports the number of general clicks and minutes on screen for each registered application in Kibana. +This collector reports the number of general clicks and minutes on screen for each registered application in OpenSearch Dashboards. The final payload matches the following contract: @@ -24,7 +24,7 @@ The final payload matches the following contract: Where `application_ID` matches the `id` registered when calling the method `core.application.register`. This collection occurs by default for every application registered via the mentioned method and there is no need to do anything else to enable it or _opt-in_ for your plugin. -**Note to maintainers in the Kibana repo:** At the moment of writing, the `usageCollector.schema` is not updated automatically ([#70622](https://github.com/elastic/kibana/issues/70622)) so, if you are adding a new app to Kibana, you'll need to give the Kibana Telemetry team a heads up to update the mappings in the Telemetry Cluster accordingly. +**Note to maintainers in the OpenSearch Dashboards repo:** At the moment of writing, the `usageCollector.schema` is not updated automatically ([#70622](https://github.com/elastic/kibana/issues/70622)) so, if you are adding a new app to OpenSearch Dashboards, you'll need to give the OpenSearch Dashboards Telemetry team a heads up to update the mappings in the Telemetry Cluster accordingly. ## Developer notes diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/index.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/application_usage/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/index.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/rollups.test.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/rollups.test.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/rollups.ts similarity index 97% rename from src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/rollups.ts index 3020147e95d..9c0dd198131 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/rollups.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ISavedObjectsRepository, SavedObject, Logger } from 'kibana/server'; +import { ISavedObjectsRepository, SavedObject, Logger } from 'opensearch-dashboards/server'; import moment from 'moment'; import { ApplicationUsageDaily, @@ -81,7 +81,7 @@ export async function rollDailyData(logger: Logger, savedObjectsClient?: ISavedO type: SAVED_OBJECTS_DAILY_TYPE, id, attributes, - version, // Providing version to ensure via conflict matching that only 1 Kibana instance (or interval) is taking care of the updates + version, // Providing version to ensure via conflict matching that only 1 OpenSearch Dashboards instance (or interval) is taking care of the updates })), { overwrite: true } ); diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/saved_objects_types.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/saved_objects_types.ts similarity index 98% rename from src/plugins/kibana_usage_collection/server/collectors/application_usage/saved_objects_types.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/saved_objects_types.ts index 861dc98c0c4..bd2b13ec878 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/saved_objects_types.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/saved_objects_types.ts @@ -17,7 +17,7 @@ * under the License. */ -import { SavedObjectAttributes, SavedObjectsServiceSetup } from 'kibana/server'; +import { SavedObjectAttributes, SavedObjectsServiceSetup } from 'opensearch-dashboards/server'; /** * Used for accumulating the totals of all the stats older than 90d diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/schema.ts similarity index 97% rename from src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/schema.ts index 2e79cdaa7fc..46e14376d67 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/schema.ts @@ -55,7 +55,7 @@ export const applicationUsageSchema = { dev_tools: commonSchema, discover: commonSchema, home: commonSchema, - kibana: commonSchema, // It's a forward app so we'll likely never report it + opensearch_dashboards: commonSchema, // It's a forward app so we'll likely never report it management: commonSchema, short_url_redirect: commonSchema, // It's a forward app so we'll likely never report it timelion: commonSchema, diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.test.ts similarity index 98% rename from src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.test.ts index 23a77c2d4c2..6b52e2c2605 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.test.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.test.ts @@ -20,7 +20,7 @@ import { savedObjectsRepositoryMock, loggingSystemMock, - elasticsearchServiceMock, + opensearchDashboardsServiceMock, } from '../../../../../core/server/mocks'; import { CollectorOptions, @@ -54,7 +54,7 @@ describe('telemetry_application_usage', () => { const getUsageCollector = jest.fn(); const registerType = jest.fn(); const callCluster = jest.fn(); - const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; + const esClient = opensearchDashboardsServiceMock.createClusterClient().asInternalUser; beforeAll(() => registerApplicationUsageCollector(logger, usageCollectionMock, registerType, getUsageCollector) diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts similarity index 99% rename from src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts index 36c89d0a0b4..ecbbd824f8d 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts @@ -19,7 +19,7 @@ import moment from 'moment'; import { timer } from 'rxjs'; -import { ISavedObjectsRepository, Logger, SavedObjectsServiceSetup } from 'kibana/server'; +import { ISavedObjectsRepository, Logger, SavedObjectsServiceSetup } from 'opensearch-dashboards/server'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { ApplicationUsageDaily, diff --git a/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/core/core_usage_collector.ts similarity index 99% rename from src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/core/core_usage_collector.ts index 297baf016e9..9bc0a406019 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/core/core_usage_collector.ts @@ -29,7 +29,7 @@ export function getCoreUsageCollector( isReady: () => typeof getCoreUsageDataService() !== 'undefined', schema: { config: { - elasticsearch: { + opensearch: { sniffOnStart: { type: 'boolean' }, sniffIntervalMs: { type: 'long' }, sniffOnConnectionFault: { type: 'boolean' }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/core/index.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/core/index.test.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/core/index.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/core/index.test.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/core/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/core/index.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/core/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/core/index.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/csp/csp_collector.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/csp/csp_collector.test.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/csp/csp_collector.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/csp/csp_collector.test.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/csp/csp_collector.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/csp/csp_collector.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/csp/csp_collector.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/csp/csp_collector.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/csp/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/csp/index.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/csp/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/csp/index.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/index.ts similarity index 93% rename from src/plugins/kibana_usage_collection/server/collectors/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/index.ts index 2408dc84c2e..3196d8720b0 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/index.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/index.ts @@ -20,7 +20,7 @@ export { registerUiMetricUsageCollector } from './ui_metric'; export { registerManagementUsageCollector } from './management'; export { registerApplicationUsageCollector } from './application_usage'; -export { registerKibanaUsageCollector } from './kibana'; +export { registerOpenSearchDashboardsUsageCollector } from './opensearch_dashboards'; export { registerOpsStatsCollector } from './ops_stats'; export { registerCspCollector } from './csp'; export { registerCoreUsageCollector } from './core'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/__snapshots__/index.test.ts.snap b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/__snapshots__/index.test.ts.snap similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/management/__snapshots__/index.test.ts.snap rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/__snapshots__/index.test.ts.snap diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/index.test.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/index.test.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/index.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/management/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/index.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/schema.ts similarity index 97% rename from src/plugins/kibana_usage_collection/server/collectors/management/schema.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/schema.ts index 792ac24b4de..4ef031244d0 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/schema.ts @@ -20,7 +20,7 @@ import { MakeSchemaFrom } from 'src/plugins/usage_collection/server'; import { UsageStats } from './telemetry_management_collector'; -// Retrieved by changing all the current settings in Kibana (we'll need to revisit it in the future). +// Retrieved by changing all the current settings in OpenSearch Dashboards (we'll need to revisit it in the future). // I would suggest we use flattened type for the mappings of this collector. export const stackManagementSchema: MakeSchemaFrom = { 'visualize:enableLabs': { type: 'boolean' }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/telemetry_management_collector.ts similarity index 97% rename from src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/telemetry_management_collector.ts index 612b1714020..963f3b281d6 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/management/telemetry_management_collector.ts @@ -17,7 +17,7 @@ * under the License. */ -import { IUiSettingsClient } from 'kibana/server'; +import { IUiSettingsClient } from 'opensearch-dashboards/server'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { stackManagementSchema } from './schema'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/get_saved_object_counts.test.ts similarity index 97% rename from src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/get_saved_object_counts.test.ts index a7681e17664..87913067079 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.test.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/get_saved_object_counts.test.ts @@ -23,7 +23,7 @@ describe('getSavedObjectsCounts', () => { test('Get all the saved objects equal to 0 because no results were found', async () => { const callCluster = jest.fn(() => ({})); - const results = await getSavedObjectsCounts(callCluster as any, '.kibana'); + const results = await getSavedObjectsCounts(callCluster as any, '.opensearch-dashboards'); expect(results).toStrictEqual({ dashboard: { total: 0 }, visualization: { total: 0 }, @@ -48,7 +48,7 @@ describe('getSavedObjectsCounts', () => { }, })); - const results = await getSavedObjectsCounts(callCluster as any, '.kibana'); + const results = await getSavedObjectsCounts(callCluster as any, '.opensearch-dashboards'); expect(results).toStrictEqual({ dashboard: { total: 1 }, visualization: { total: 0 }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/get_saved_object_counts.ts similarity index 78% rename from src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/get_saved_object_counts.ts index e88d90fe5b2..a7be7476f39 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/kibana/get_saved_object_counts.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/get_saved_object_counts.ts @@ -18,7 +18,7 @@ */ /** - * Moved from /x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_kibana_usage_collector.ts + * Moved from /x-pack/plugins/monitoring/server/opensearch_dashboards_monitoring/collectors/get_opensearch_dashboards_usage_collector.ts * * The PR https://github.com/elastic/kibana/pull/62665 proved what the issue https://github.com/elastic/kibana/issues/58249 * was claiming: the structure and payload for common telemetry bits differs between Monitoring and OSS/X-Pack collections. @@ -27,7 +27,7 @@ */ import { snakeCase } from 'lodash'; -import { LegacyAPICaller } from 'kibana/server'; +import { LegacyAPICaller } from 'opensearch-dashboards/server'; const TYPES = [ 'dashboard', @@ -38,7 +38,7 @@ const TYPES = [ 'timelion-sheet', ]; -export interface KibanaSavedObjectCounts { +export interface OpenSearchDashboardsSavedObjectCounts { dashboard: { total: number }; visualization: { total: number }; search: { total: number }; @@ -49,10 +49,10 @@ export interface KibanaSavedObjectCounts { export async function getSavedObjectsCounts( callCluster: LegacyAPICaller, - kibanaIndex: string // Typically '.kibana'. We might need a way to obtain it from the SavedObjects client (or the SavedObjects client to provide a way to run aggregations?) -): Promise { + opensearchDashboardsIndex: string // Typically '.opensearch-dashboards'. We might need a way to obtain it from the SavedObjects client (or the SavedObjects client to provide a way to run aggregations?) +): Promise { const savedObjectCountSearchParams = { - index: kibanaIndex, + index: opensearchDashboardsIndex, ignoreUnavailable: true, filterPath: 'aggregations.types.buckets', body: { @@ -72,9 +72,9 @@ export async function getSavedObjectsCounts( resp.aggregations?.types?.buckets || []; // Initialise the object with all zeros for all the types - const allZeros: KibanaSavedObjectCounts = TYPES.reduce( + const allZeros: OpenSearchDashboardsSavedObjectCounts = TYPES.reduce( (acc, type) => ({ ...acc, [snakeCase(type)]: { total: 0 } }), - {} as KibanaSavedObjectCounts + {} as OpenSearchDashboardsSavedObjectCounts ); // Add the doc_count from each bucket diff --git a/src/plugins/kibana_usage_collection/server/collectors/kibana/index.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/index.test.ts similarity index 85% rename from src/plugins/kibana_usage_collection/server/collectors/kibana/index.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/index.test.ts index 2bfe59d7dd4..3b78056b7bf 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/kibana/index.test.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/index.test.ts @@ -23,9 +23,9 @@ import { createUsageCollectionSetupMock, } from '../../../../usage_collection/server/usage_collection.mock'; -import { registerKibanaUsageCollector } from './'; +import { registerOpenSearchDashboardsUsageCollector } from './'; -describe('telemetry_kibana', () => { +describe('telemetry_opensearch_dashboards', () => { let collector: CollectorOptions; const usageCollectionMock = createUsageCollectionSetupMock(); @@ -37,17 +37,17 @@ describe('telemetry_kibana', () => { const legacyConfig$ = pluginInitializerContextConfigMock({}).legacy.globalConfig$; const callCluster = jest.fn().mockImplementation(() => ({})); - beforeAll(() => registerKibanaUsageCollector(usageCollectionMock, legacyConfig$)); + beforeAll(() => registerOpenSearchDashboardsUsageCollector(usageCollectionMock, legacyConfig$)); afterAll(() => jest.clearAllTimers()); test('registered collector is set', () => { expect(collector).not.toBeUndefined(); - expect(collector.type).toBe('kibana'); + expect(collector.type).toBe('opensearchDashboards'); }); test('fetch', async () => { expect(await collector.fetch(callCluster)).toStrictEqual({ - index: '.kibana-tests', + index: '.opensearch-dashboards-tests', dashboard: { total: 0 }, visualization: { total: 0 }, search: { total: 0 }, @@ -59,7 +59,7 @@ describe('telemetry_kibana', () => { test('formatForBulkUpload', async () => { const resultFromFetch = { - index: '.kibana-tests', + index: '.opensearch-dashboards-tests', dashboard: { total: 0 }, visualization: { total: 0 }, search: { total: 0 }, @@ -69,7 +69,7 @@ describe('telemetry_kibana', () => { }; expect(collector.formatForBulkUpload!(resultFromFetch)).toStrictEqual({ - type: 'kibana_stats', + type: 'opensearch_dashboards_stats', payload: { usage: resultFromFetch, }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/kibana/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/index.ts similarity index 88% rename from src/plugins/kibana_usage_collection/server/collectors/kibana/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/index.ts index 695d972346b..53173297576 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/kibana/index.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/index.ts @@ -17,4 +17,4 @@ * under the License. */ -export { registerKibanaUsageCollector } from './kibana_usage_collector'; +export { registerOpenSearchDashboardsUsageCollector } from './opensearch_dashboards_usage_collector'; diff --git a/src/plugins/kibana_usage_collection/server/collectors/kibana/kibana_usage_collector.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/opensearch_dashboards_usage_collector.ts similarity index 70% rename from src/plugins/kibana_usage_collection/server/collectors/kibana/kibana_usage_collector.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/opensearch_dashboards_usage_collector.ts index 5b56e1a9b59..a30b657e6da 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/kibana/kibana_usage_collector.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/opensearch_dashboards/opensearch_dashboards_usage_collector.ts @@ -19,21 +19,21 @@ import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; -import { SharedGlobalConfig } from 'kibana/server'; +import { SharedGlobalConfig } from 'opensearch-dashboards/server'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; -import { KIBANA_STATS_TYPE } from '../../../common/constants'; -import { getSavedObjectsCounts, KibanaSavedObjectCounts } from './get_saved_object_counts'; +import { OPENSEARCH_DASHBOARDS_STATS_TYPE } from '../../../common/constants'; +import { getSavedObjectsCounts, OpenSearchDashboardsSavedObjectCounts } from './get_saved_object_counts'; -interface KibanaUsage extends KibanaSavedObjectCounts { +interface OpenSearchDashboardsUsage extends OpenSearchDashboardsSavedObjectCounts { index: string; } -export function getKibanaUsageCollector( +export function getOpenSearchDashboardsUsageCollector( usageCollection: UsageCollectionSetup, legacyConfig$: Observable ) { - return usageCollection.makeUsageCollector({ - type: 'kibana', + return usageCollection.makeUsageCollector({ + type: 'opensearchDashboards', isReady: () => true, schema: { index: { type: 'keyword' }, @@ -46,7 +46,7 @@ export function getKibanaUsageCollector( }, async fetch(callCluster) { const { - kibana: { index }, + opensearchDashboards: { index }, } = await legacyConfig$.pipe(take(1)).toPromise(); return { index, @@ -56,12 +56,12 @@ export function getKibanaUsageCollector( /* * Format the response data into a model for internal upload - * 1. Make this data part of the "kibana_stats" type + * 1. Make this data part of the "opensearch_dashboards_stats" type * 2. Organize the payload in the usage namespace of the data payload (usage.index, etc) */ formatForBulkUpload: (result) => { return { - type: KIBANA_STATS_TYPE, + type: OPENSEARCH_DASHBOARDS_STATS_TYPE, payload: { usage: result, }, @@ -70,9 +70,9 @@ export function getKibanaUsageCollector( }); } -export function registerKibanaUsageCollector( +export function registerOpenSearchDashboardsUsageCollector( usageCollection: UsageCollectionSetup, legacyConfig$: Observable ) { - usageCollection.registerCollector(getKibanaUsageCollector(usageCollection, legacyConfig$)); + usageCollection.registerCollector(getOpenSearchDashboardsUsageCollector(usageCollection, legacyConfig$)); } diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/__snapshots__/index.test.ts.snap b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/__snapshots__/index.test.ts.snap similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/ops_stats/__snapshots__/index.test.ts.snap rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/__snapshots__/index.test.ts.snap diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/index.test.ts similarity index 98% rename from src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/index.test.ts index a527d4d03c6..7538eb35daa 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/index.test.ts @@ -82,7 +82,7 @@ describe('telemetry_ops_stats', () => { test('registered collector is set', () => { expect(collector).not.toBeUndefined(); - expect(collector.type).toBe('kibana_stats'); + expect(collector.type).toBe('opensearch_dashboards_stats'); }); test('isReady should return false because no metrics have been provided yet', () => { diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/index.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/index.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts similarity index 90% rename from src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts index d3be6015405..9d46322d251 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts @@ -20,9 +20,9 @@ import { Observable } from 'rxjs'; import { cloneDeep, omit } from 'lodash'; import moment from 'moment'; -import { OpsMetrics } from 'kibana/server'; +import { OpsMetrics } from 'opensearch-dashboards/server'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; -import { KIBANA_STATS_TYPE } from '../../../common/constants'; +import { OPENSEARCH_DASHBOARDS_STATS_TYPE } from '../../../common/constants'; interface OpsStatsMetrics extends Omit { timestamp: string; @@ -33,7 +33,7 @@ interface OpsStatsMetrics extends Omit !!lastMetrics, fetch: () => lastMetrics, }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/index.test.ts similarity index 95% rename from src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/index.test.ts index d6f40a2a686..44535f2bf9f 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.test.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/index.test.ts @@ -75,7 +75,7 @@ describe('telemetry_ui_metric', () => { { id: 'testAppName2:testKeyName3', attributes: { count: 1 } }, { id: - 'kibana-user_agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0', + 'opensearch-dashboards-user_agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0', attributes: { count: 1 }, }, ], @@ -91,7 +91,7 @@ describe('telemetry_ui_metric', () => { { key: 'testKeyName2', value: 5 }, ], testAppName2: [{ key: 'testKeyName3', value: 1 }], - 'kibana-user_agent': [ + 'opensearch-dashboards-user_agent': [ { key: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0', value: 1, diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/index.ts similarity index 100% rename from src/plugins/kibana_usage_collection/server/collectors/ui_metric/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/index.ts diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/schema.ts similarity index 93% rename from src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/schema.ts index 53bb1f9b939..c62998c1ee6 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/schema.ts @@ -35,7 +35,7 @@ const uiMetricFromDataPluginSchema: MakeSchemaFrom = { dev_tools: commonSchema, discover: commonSchema, home: commonSchema, - kibana: commonSchema, // It's a forward app so we'll likely never report it + opensearch_dashboards: commonSchema, // It's a forward app so we'll likely never report it management: commonSchema, short_url_redirect: commonSchema, // It's a forward app so we'll likely never report it timelion: commonSchema, @@ -80,11 +80,11 @@ const uiMetricFromDataPluginSchema: MakeSchemaFrom = { }; // TODO: Find a way to retrieve it automatically -// Searching `reportUiStats` across Kibana +// Searching `reportUiStats` across OpenSearch Dashboards export const uiMetricSchema: MakeSchemaFrom = { console: commonSchema, DashboardPanelVersionInUrl: commonSchema, - Kibana_home: commonSchema, // eslint-disable-line @typescript-eslint/naming-convention + OpenSearch_Dashboards_home: commonSchema, // eslint-disable-line @typescript-eslint/naming-convention visualize: commonSchema, canvas: commonSchema, cross_cluster_replication: commonSchema, diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts similarity index 98% rename from src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts index 4cae892d30b..e8fcd6ffcd6 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts @@ -21,7 +21,7 @@ import { ISavedObjectsRepository, SavedObjectAttributes, SavedObjectsServiceSetup, -} from 'kibana/server'; +} from 'opensearch-dashboards/server'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { uiMetricSchema } from './schema'; diff --git a/src/plugins/kibana_usage_collection/server/index.test.ts b/src/plugins/opensearch_dashboards_usage_collection/server/index.test.ts similarity index 97% rename from src/plugins/kibana_usage_collection/server/index.test.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/index.test.ts index d4b065896c8..278f02095da 100644 --- a/src/plugins/kibana_usage_collection/server/index.test.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/index.test.ts @@ -29,7 +29,7 @@ import { import { plugin } from './'; -describe('kibana_usage_collection', () => { +describe('opensearch_dashboards_usage_collection', () => { const pluginInstance = plugin(coreMock.createPluginInitializerContext({})); const usageCollectors: CollectorOptions[] = []; diff --git a/src/plugins/kibana_usage_collection/server/index.ts b/src/plugins/opensearch_dashboards_usage_collection/server/index.ts similarity index 82% rename from src/plugins/kibana_usage_collection/server/index.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/index.ts index 968a28fcf91..39ecd6eee0c 100644 --- a/src/plugins/kibana_usage_collection/server/index.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/index.ts @@ -18,11 +18,11 @@ */ import { PluginInitializerContext } from '../../../core/server'; -import { KibanaUsageCollectionPlugin } from './plugin'; +import { OpenSearchDashboardsUsageCollectionPlugin } from './plugin'; // This exports static code and TypeScript types, -// as well as, Kibana Platform `plugin()` initializer. +// as well as, OpenSearch Dashboards Platform `plugin()` initializer. export function plugin(initializerContext: PluginInitializerContext) { - return new KibanaUsageCollectionPlugin(initializerContext); + return new OpenSearchDashboardsUsageCollectionPlugin(initializerContext); } diff --git a/src/plugins/kibana_usage_collection/server/plugin.ts b/src/plugins/opensearch_dashboards_usage_collection/server/plugin.ts similarity index 90% rename from src/plugins/kibana_usage_collection/server/plugin.ts rename to src/plugins/opensearch_dashboards_usage_collection/server/plugin.ts index 198fdbb7a87..868ad9402af 100644 --- a/src/plugins/kibana_usage_collection/server/plugin.ts +++ b/src/plugins/opensearch_dashboards_usage_collection/server/plugin.ts @@ -35,7 +35,7 @@ import { } from '../../../core/server'; import { registerApplicationUsageCollector, - registerKibanaUsageCollector, + registerOpenSearchDashboardsUsageCollector, registerManagementUsageCollector, registerOpsStatsCollector, registerUiMetricUsageCollector, @@ -43,13 +43,13 @@ import { registerCoreUsageCollector, } from './collectors'; -interface KibanaUsageCollectionPluginsDepsSetup { +interface OpenSearchDashboardsUsageCollectionPluginsDepsSetup { usageCollection: UsageCollectionSetup; } type SavedObjectsRegisterType = SavedObjectsServiceSetup['registerType']; -export class KibanaUsageCollectionPlugin implements Plugin { +export class OpenSearchDashboardsUsageCollectionPlugin implements Plugin { private readonly logger: Logger; private readonly legacyConfig$: Observable; private savedObjectsClient?: ISavedObjectsRepository; @@ -63,7 +63,7 @@ export class KibanaUsageCollectionPlugin implements Plugin { this.metric$ = new Subject(); } - public setup(coreSetup: CoreSetup, { usageCollection }: KibanaUsageCollectionPluginsDepsSetup) { + public setup(coreSetup: CoreSetup, { usageCollection }: OpenSearchDashboardsUsageCollectionPluginsDepsSetup) { this.registerUsageCollectors(usageCollection, coreSetup, this.metric$, (opts) => coreSetup.savedObjects.registerType(opts) ); @@ -93,7 +93,7 @@ export class KibanaUsageCollectionPlugin implements Plugin { const getCoreUsageDataService = () => this.coreUsageData!; registerOpsStatsCollector(usageCollection, metric$); - registerKibanaUsageCollector(usageCollection, this.legacyConfig$); + registerOpenSearchDashboardsUsageCollector(usageCollection, this.legacyConfig$); registerManagementUsageCollector(usageCollection, getUiSettingsClient); registerUiMetricUsageCollector(usageCollection, registerType, getSavedObjectsClient); registerApplicationUsageCollector(