"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.uiMetricService = exports.UiMetricService = exports.UIM_RESET_LOGS_COUNTER_CLICK = exports.UIM_REINDEX_STOP_CLICK = exports.UIM_REINDEX_START_CLICK = exports.UIM_REINDEX_OPEN_FLYOUT_CLICK = exports.UIM_REINDEX_CLOSE_FLYOUT_CLICK = exports.UIM_OVERVIEW_PAGE_LOAD = exports.UIM_OBSERVABILITY_CLICK = exports.UIM_ML_SNAPSHOT_UPGRADE_CLICK = exports.UIM_ML_SNAPSHOT_DELETE_CLICK = exports.UIM_KIBANA_QUICK_RESOLVE_CLICK = exports.UIM_KIBANA_DEPRECATIONS_PAGE_LOAD = exports.UIM_INDEX_SETTINGS_DELETE_CLICK = exports.UIM_ES_DEPRECATION_LOGS_PAGE_LOAD = exports.UIM_ES_DEPRECATIONS_PAGE_LOAD = exports.UIM_DISCOVER_CLICK = exports.UIM_CLUSTER_SETTINGS_DELETE_CLICK = exports.UIM_BACKUP_DATA_ON_PREM_CLICK = exports.UIM_BACKUP_DATA_CLOUD_CLICK = exports.UIM_APP_NAME = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ const UIM_APP_NAME = 'upgrade_assistant'; exports.UIM_APP_NAME = UIM_APP_NAME; const UIM_ES_DEPRECATIONS_PAGE_LOAD = 'es_deprecations_page_load'; exports.UIM_ES_DEPRECATIONS_PAGE_LOAD = UIM_ES_DEPRECATIONS_PAGE_LOAD; const UIM_KIBANA_DEPRECATIONS_PAGE_LOAD = 'kibana_deprecations_page_load'; exports.UIM_KIBANA_DEPRECATIONS_PAGE_LOAD = UIM_KIBANA_DEPRECATIONS_PAGE_LOAD; const UIM_OVERVIEW_PAGE_LOAD = 'overview_page_load'; exports.UIM_OVERVIEW_PAGE_LOAD = UIM_OVERVIEW_PAGE_LOAD; const UIM_ES_DEPRECATION_LOGS_PAGE_LOAD = 'es_deprecation_logs_page_load'; exports.UIM_ES_DEPRECATION_LOGS_PAGE_LOAD = UIM_ES_DEPRECATION_LOGS_PAGE_LOAD; const UIM_REINDEX_OPEN_FLYOUT_CLICK = 'reindex_open_flyout_click'; exports.UIM_REINDEX_OPEN_FLYOUT_CLICK = UIM_REINDEX_OPEN_FLYOUT_CLICK; const UIM_REINDEX_CLOSE_FLYOUT_CLICK = 'reindex_close_flyout_click'; exports.UIM_REINDEX_CLOSE_FLYOUT_CLICK = UIM_REINDEX_CLOSE_FLYOUT_CLICK; const UIM_REINDEX_START_CLICK = 'reindex_start_click'; exports.UIM_REINDEX_START_CLICK = UIM_REINDEX_START_CLICK; const UIM_REINDEX_STOP_CLICK = 'reindex_stop_click'; exports.UIM_REINDEX_STOP_CLICK = UIM_REINDEX_STOP_CLICK; const UIM_BACKUP_DATA_CLOUD_CLICK = 'backup_data_cloud_click'; exports.UIM_BACKUP_DATA_CLOUD_CLICK = UIM_BACKUP_DATA_CLOUD_CLICK; const UIM_BACKUP_DATA_ON_PREM_CLICK = 'backup_data_on_prem_click'; exports.UIM_BACKUP_DATA_ON_PREM_CLICK = UIM_BACKUP_DATA_ON_PREM_CLICK; const UIM_RESET_LOGS_COUNTER_CLICK = 'reset_logs_counter_click'; exports.UIM_RESET_LOGS_COUNTER_CLICK = UIM_RESET_LOGS_COUNTER_CLICK; const UIM_OBSERVABILITY_CLICK = 'observability_click'; exports.UIM_OBSERVABILITY_CLICK = UIM_OBSERVABILITY_CLICK; const UIM_DISCOVER_CLICK = 'discover_click'; exports.UIM_DISCOVER_CLICK = UIM_DISCOVER_CLICK; const UIM_ML_SNAPSHOT_UPGRADE_CLICK = 'ml_snapshot_upgrade_click'; exports.UIM_ML_SNAPSHOT_UPGRADE_CLICK = UIM_ML_SNAPSHOT_UPGRADE_CLICK; const UIM_ML_SNAPSHOT_DELETE_CLICK = 'ml_snapshot_delete_click'; exports.UIM_ML_SNAPSHOT_DELETE_CLICK = UIM_ML_SNAPSHOT_DELETE_CLICK; const UIM_INDEX_SETTINGS_DELETE_CLICK = 'index_settings_delete_click'; exports.UIM_INDEX_SETTINGS_DELETE_CLICK = UIM_INDEX_SETTINGS_DELETE_CLICK; const UIM_KIBANA_QUICK_RESOLVE_CLICK = 'kibana_quick_resolve_click'; exports.UIM_KIBANA_QUICK_RESOLVE_CLICK = UIM_KIBANA_QUICK_RESOLVE_CLICK; const UIM_CLUSTER_SETTINGS_DELETE_CLICK = 'cluster_settings_delete_click'; exports.UIM_CLUSTER_SETTINGS_DELETE_CLICK = UIM_CLUSTER_SETTINGS_DELETE_CLICK; class UiMetricService { constructor() { (0, _defineProperty2.default)(this, "usageCollection", void 0); } setup(usageCollection) { this.usageCollection = usageCollection; } track(metricType, eventName) { if (!this.usageCollection) { // Usage collection might be disabled in Kibana config. return; } return this.usageCollection.reportUiCounter(UIM_APP_NAME, metricType, eventName); } trackUiMetric(metricType, eventName) { return this.track(metricType, eventName); } } exports.UiMetricService = UiMetricService; const uiMetricService = new UiMetricService(); exports.uiMetricService = uiMetricService;