diff --git a/x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx b/x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx index 8bb1933f84955..9bf078f76bcfb 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx @@ -11,7 +11,7 @@ import { EuiBasicTable, EuiBasicTableColumn } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import type { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; import type { Criteria } from '@elastic/eui/src/components/basic_table/basic_table'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; import { useTheme } from '../../../hooks/use_theme'; import type { FieldValuePair } from '../../../../common/correlations/types'; diff --git a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx index af9dccbc4c672..226ba6287d387 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx @@ -26,7 +26,7 @@ import type { Direction } from '@elastic/eui/src/services/sort/sort_direction'; import { i18n } from '@kbn/i18n'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { FieldStatsPopover } from './context_popover/field_stats_popover'; diff --git a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx index 0a53cb0f3b40f..5a8754403311f 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx @@ -25,7 +25,7 @@ import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/tab import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { FieldStatsPopover } from './context_popover/field_stats_popover'; diff --git a/x-pack/plugins/apm/public/components/app/dependencies_inventory/dependencies_inventory_table/index.tsx b/x-pack/plugins/apm/public/components/app/dependencies_inventory/dependencies_inventory_table/index.tsx index c04fb9211d91b..d7f4e5f5bee2c 100644 --- a/x-pack/plugins/apm/public/components/app/dependencies_inventory/dependencies_inventory_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/dependencies_inventory/dependencies_inventory_table/index.tsx @@ -8,7 +8,7 @@ import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { isTimeComparison } from '../../../shared/time_comparison/get_comparison_options'; import { getNodeName, NodeType } from '../../../../../common/connections'; import { useApmParams } from '../../../../hooks/use_apm_params'; diff --git a/x-pack/plugins/apm/public/components/app/service_map/popover/dependency_contents.tsx b/x-pack/plugins/apm/public/components/app/service_map/popover/dependency_contents.tsx index 9ec7773f91c8f..506873c65854e 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/popover/dependency_contents.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/popover/dependency_contents.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { TypeOf } from '@kbn/typed-react-router-config'; import { METRIC_TYPE } from '@kbn/analytics'; import React from 'react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { NodeDataDefinition } from 'cytoscape'; import { isTimeComparison } from '../../../shared/time_comparison/get_comparison_options'; import { ContentsProps } from '.'; diff --git a/x-pack/plugins/apm/public/components/app/service_map/popover/edge_contents.tsx b/x-pack/plugins/apm/public/components/app/service_map/popover/edge_contents.tsx index e5e3de188de4c..aa1a4959a4a70 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/popover/edge_contents.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/popover/edge_contents.tsx @@ -9,7 +9,7 @@ import { EuiButton, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import React from 'react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { EdgeDataDefinition } from 'cytoscape'; import { ContentsProps } from '.'; import { useAnyOfApmParams } from '../../../../hooks/use_apm_params'; diff --git a/x-pack/plugins/apm/public/components/app/service_map/use_cytoscape_event_handlers.test.tsx b/x-pack/plugins/apm/public/components/app/service_map/use_cytoscape_event_handlers.test.tsx index 21a65b5dc090b..cb9372b2b8661 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/use_cytoscape_event_handlers.test.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/use_cytoscape_event_handlers.test.tsx @@ -9,11 +9,11 @@ import { renderHook } from '@testing-library/react-hooks'; import cytoscape from 'cytoscape'; import dagre from 'cytoscape-dagre'; import { EuiTheme } from '@kbn/kibana-react-plugin/common'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { useCytoscapeEventHandlers } from './use_cytoscape_event_handlers'; import lodash from 'lodash'; -jest.mock('@kbn/observability-plugin/public'); +jest.mock('@kbn/observability-shared-plugin/public'); cytoscape.use(dagre); diff --git a/x-pack/plugins/apm/public/components/app/service_map/use_cytoscape_event_handlers.ts b/x-pack/plugins/apm/public/components/app/service_map/use_cytoscape_event_handlers.ts index cce9972aa91c9..c5e442f363197 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/use_cytoscape_event_handlers.ts +++ b/x-pack/plugins/apm/public/components/app/service_map/use_cytoscape_event_handlers.ts @@ -9,7 +9,7 @@ import cytoscape from 'cytoscape'; import { debounce } from 'lodash'; import { useEffect } from 'react'; import { EuiTheme } from '@kbn/kibana-react-plugin/common'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { getAnimationOptions, getNodeHeight } from './cytoscape_options'; /* diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx index ca39fb50fb7b8..f95905dd3dc57 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx @@ -9,7 +9,7 @@ import { EuiIcon, EuiToolTip } from '@elastic/eui'; import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; import React, { ReactNode } from 'react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { isTimeComparison } from '../../../shared/time_comparison/get_comparison_options'; import { getNodeName, NodeType } from '../../../../../common/connections'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; diff --git a/x-pack/plugins/apm/public/components/app/settings/agent_configurations/agent_configuration_create_edit/settings_page/settings_page.tsx b/x-pack/plugins/apm/public/components/app/settings/agent_configurations/agent_configuration_create_edit/settings_page/settings_page.tsx index 0130e80510573..d651957f0771a 100644 --- a/x-pack/plugins/apm/public/components/app/settings/agent_configurations/agent_configuration_create_edit/settings_page/settings_page.tsx +++ b/x-pack/plugins/apm/public/components/app/settings/agent_configurations/agent_configuration_create_edit/settings_page/settings_page.tsx @@ -17,7 +17,7 @@ import { EuiStat, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import React, { useMemo, useState } from 'react'; import { useHistory } from 'react-router-dom'; import { getOptionLabel } from '../../../../../../../common/agent_configuration/all_option'; diff --git a/x-pack/plugins/apm/public/components/app/settings/schema/confirm_switch_modal.tsx b/x-pack/plugins/apm/public/components/app/settings/schema/confirm_switch_modal.tsx index 0e39d37254b67..d7082543baabd 100644 --- a/x-pack/plugins/apm/public/components/app/settings/schema/confirm_switch_modal.tsx +++ b/x-pack/plugins/apm/public/components/app/settings/schema/confirm_switch_modal.tsx @@ -15,7 +15,7 @@ import { htmlIdGenerator, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { ElasticDocsLink } from '../../../shared/links/elastic_docs_link'; interface Props { diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/failed_transactions_correlations_tab.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/failed_transactions_correlations_tab.tsx index a0a69629d0d2c..387b6819186be 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/failed_transactions_correlations_tab.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/failed_transactions_correlations_tab.tsx @@ -9,7 +9,10 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { METRIC_TYPE, useTrackMetric } from '@kbn/observability-plugin/public'; +import { + METRIC_TYPE, + useTrackMetric, +} from '@kbn/observability-shared-plugin/public'; import { isActivePlatinumLicense } from '../../../../common/license_check'; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/latency_correlations_tab.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/latency_correlations_tab.tsx index 1fef9ac0dda66..663b9d62e8db4 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/latency_correlations_tab.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/latency_correlations_tab.tsx @@ -9,7 +9,10 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { METRIC_TYPE, useTrackMetric } from '@kbn/observability-plugin/public'; +import { + METRIC_TYPE, + useTrackMetric, +} from '@kbn/observability-shared-plugin/public'; import { isActivePlatinumLicense } from '../../../../common/license_check'; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx index bb942a735792c..e0b1c72e50da4 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx @@ -7,7 +7,10 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; -import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { + METRIC_TYPE, + useUiTracker, +} from '@kbn/observability-shared-plugin/public'; import { SERVICE_NAME, SPAN_DESTINATION_SERVICE_RESOURCE, diff --git a/x-pack/plugins/apm/public/components/routing/app_root/apm_header_action_menu/labs/index.tsx b/x-pack/plugins/apm/public/components/routing/app_root/apm_header_action_menu/labs/index.tsx index ac506495ceffc..8918e333bcc0c 100644 --- a/x-pack/plugins/apm/public/components/routing/app_root/apm_header_action_menu/labs/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/app_root/apm_header_action_menu/labs/index.tsx @@ -8,7 +8,7 @@ import { EuiButtonEmpty } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useEffect, useState } from 'react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { LabsFlyout } from './labs_flyout'; export function Labs() { diff --git a/x-pack/plugins/apm/public/components/routing/track_pageview.tsx b/x-pack/plugins/apm/public/components/routing/track_pageview.tsx index ea31702a187ac..37ccc85563d7c 100644 --- a/x-pack/plugins/apm/public/components/routing/track_pageview.tsx +++ b/x-pack/plugins/apm/public/components/routing/track_pageview.tsx @@ -5,7 +5,7 @@ * 2.0. */ import { useRoutePath } from '@kbn/typed-react-router-config'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; export function TrackPageview({ children }: { children: React.ReactElement }) { const routePath = useRoutePath(); diff --git a/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart_with_scrubber/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart_with_scrubber/index.tsx index 0cd1c0f2b639a..78f649176a911 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart_with_scrubber/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart_with_scrubber/index.tsx @@ -7,7 +7,7 @@ import { BrushEndListener, BrushEvent, XYBrushEvent } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { EuiBadge, EuiFlexGroup, diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx b/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx index f637db9c0c153..a74c130d61ef9 100644 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import React, { useMemo } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { useApmRouter } from '../../../hooks/use_apm_router'; import { useEnvironmentsContext } from '../../../context/environments_context/use_environments_context'; import { useAnomalyDetectionJobsContext } from '../../../context/anomaly_detection_jobs/use_anomaly_detection_jobs_context'; diff --git a/x-pack/plugins/apm/public/hooks/use_apm_editable_settings.tsx b/x-pack/plugins/apm/public/hooks/use_apm_editable_settings.tsx index c6a559b359cf3..3ee7447eb741f 100644 --- a/x-pack/plugins/apm/public/hooks/use_apm_editable_settings.tsx +++ b/x-pack/plugins/apm/public/hooks/use_apm_editable_settings.tsx @@ -10,7 +10,7 @@ import { FieldState } from '@kbn/advanced-settings-plugin/public'; import { toEditableConfig } from '@kbn/advanced-settings-plugin/public'; import { IUiSettingsClient } from '@kbn/core/public'; import { isEmpty } from 'lodash'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; function getEditableConfig({ settingsKeys, diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index b2a049679a028..e9703c7429709 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -44,10 +44,10 @@ import type { } from '@kbn/observability-shared-plugin/public'; import { FetchDataParams, - METRIC_TYPE, ObservabilityPublicSetup, ObservabilityPublicStart, } from '@kbn/observability-plugin/public'; +import { METRIC_TYPE } from '@kbn/observability-shared-plugin/public'; import type { TriggersAndActionsUIPublicPluginSetup, TriggersAndActionsUIPublicPluginStart, diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_row.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_row.tsx index 59d34272f7368..4a137ca361a40 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_row.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_row.tsx @@ -7,9 +7,11 @@ import { i18n } from '@kbn/i18n'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { useUiTracker } from '@kbn/observability-plugin/public'; import { ObservabilityTriggerId } from '@kbn/observability-shared-plugin/common'; -import { getContextMenuItemsFromActions } from '@kbn/observability-shared-plugin/public'; +import { + useUiTracker, + getContextMenuItemsFromActions, +} from '@kbn/observability-shared-plugin/public'; import { isEmpty } from 'lodash'; import React, { memo, useCallback, useMemo, useState } from 'react'; import useAsync from 'react-use/lib/useAsync'; diff --git a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module.tsx b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module.tsx index 3695c6952cd16..7224848ba2e90 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_analysis/log_analysis_module.tsx @@ -6,7 +6,7 @@ */ import { useCallback, useMemo } from 'react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { DatasetFilter } from '../../../../common/log_analysis'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; import { useTrackedPromise } from '../../../utils/use_tracked_promise'; diff --git a/x-pack/plugins/infra/public/hooks/use_inventory_views.ts b/x-pack/plugins/infra/public/hooks/use_inventory_views.ts index a75e8beaf3f65..5bbc52e17afda 100644 --- a/x-pack/plugins/infra/public/hooks/use_inventory_views.ts +++ b/x-pack/plugins/infra/public/hooks/use_inventory_views.ts @@ -17,7 +17,7 @@ import { useQuery, useQueryClient, } from '@tanstack/react-query'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; import { MetricsSourceConfigurationResponse } from '../../common/metrics_sources'; diff --git a/x-pack/plugins/infra/public/hooks/use_metrics_explorer_views.ts b/x-pack/plugins/infra/public/hooks/use_metrics_explorer_views.ts index 34a3666b5c0e0..210a23a3b21ef 100644 --- a/x-pack/plugins/infra/public/hooks/use_metrics_explorer_views.ts +++ b/x-pack/plugins/infra/public/hooks/use_metrics_explorer_views.ts @@ -17,7 +17,7 @@ import { useQuery, useQueryClient, } from '@tanstack/react-query'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; import { MetricsSourceConfigurationResponse } from '../../common/metrics_sources'; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx index c384999fd2189..f26f8768a4459 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx @@ -14,7 +14,7 @@ import useInterval from 'react-use/lib/useInterval'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { MLJobsAwaitingNodeWarning, ML_PAGES, useMlHref } from '@kbn/ml-plugin/public'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { TimeRange } from '../../../../common/time/time_range'; import { CategoryJobNoticesSection } from '../../../components/logging/log_analysis_job_status'; import { AnalyzeInMlButton } from '../../../components/logging/log_analysis_results'; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_setup_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_setup_content.tsx index 8a74e8e8fd8ab..bed36ec93713b 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_setup_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_setup_content.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { EuiText, EuiButton } from '@elastic/eui'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; interface LogEntryCategoriesSetupContentProps { onOpenSetup: () => void; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx index 254c3730388db..f48d0e5073261 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx @@ -10,7 +10,8 @@ import { i18n } from '@kbn/i18n'; import { encode } from '@kbn/rison'; import moment from 'moment'; -import { useUiTracker, useLinkProps } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; +import { useLinkProps } from '@kbn/observability-plugin/public'; import { LogEntry, LogEntryContext } from '../../../../../../common/log_entry'; import { TimeRange } from '../../../../../../common/time'; import { diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_results_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_results_content.tsx index 2b274efcd566e..b535c1fd155de 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_results_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_results_content.tsx @@ -13,7 +13,7 @@ import React, { useCallback, useMemo } from 'react'; import { encode } from '@kbn/rison'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { MLJobsAwaitingNodeWarning } from '@kbn/ml-plugin/public'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { isJobStatusWithResults } from '../../../../common/log_analysis'; import { TimeKey } from '../../../../common/time'; import { diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_setup_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_setup_content.tsx index 3fc9c823cc54d..d5520d2a1c18d 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_setup_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_setup_content.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { EuiText, EuiButton } from '@elastic/eui'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; interface LogEntryRateSetupContentProps { onOpenSetup: () => void; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/index_names_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/logs/settings/index_names_configuration_panel.tsx index 2b26afda19041..657bab67934a2 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/index_names_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/index_names_configuration_panel.tsx @@ -8,7 +8,7 @@ import { EuiCode, EuiDescribedFormGroup, EuiFieldText, EuiFormRow } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { LogIndexNameReference } from '../../../../common/log_views'; import { FormElement } from './form_elements'; import { getFormRowProps, getInputFieldProps } from './form_field_props'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/index_pattern_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/logs/settings/index_pattern_configuration_panel.tsx index f0b945516db2d..f213af79ce158 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/index_pattern_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/index_pattern_configuration_panel.tsx @@ -8,7 +8,7 @@ import { EuiDescribedFormGroup, EuiFormRow, EuiLink, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useLinkProps } from '@kbn/observability-plugin/public'; import { LogDataViewReference } from '../../../../common/log_views'; import { FormElement } from './form_elements'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_form_state.ts b/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_form_state.ts index 7165a34fb5ba1..73df3b830d0ff 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_form_state.ts +++ b/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_form_state.ts @@ -7,7 +7,7 @@ import { useMemo } from 'react'; import { SavedObjectNotFound } from '@kbn/kibana-utils-plugin/common'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { LogDataViewReference, LogIndexNameReference, diff --git a/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_panel.tsx index 70499975b77b2..6320389fc7fc4 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_panel.tsx @@ -8,7 +8,7 @@ import { EuiCheckableCard, EuiFormFieldset, EuiSpacer, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback } from 'react'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { logIndexNameReferenceRT, LogDataViewReference, diff --git a/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_settings.tsx b/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_settings.tsx index 6ee20c00b9e64..ab61433a49ca6 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_settings.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_settings.tsx @@ -17,7 +17,8 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { Prompt, useTrackPageview } from '@kbn/observability-plugin/public'; +import { Prompt } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { SourceLoadingPage } from '../../../components/source_loading_page'; import { useLogsBreadcrumbs } from '../../../hooks/use_logs_breadcrumbs'; import { useLogViewContext } from '../../../hooks/use_log_view'; diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page.tsx index 326bc3906e5c5..62b9cbff8b2b0 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page.tsx @@ -6,7 +6,7 @@ */ import { EuiErrorBoundary } from '@elastic/eui'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import React from 'react'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; import { useLogsBreadcrumbs } from '../../../hooks/use_logs_breadcrumbs'; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/enable_hosts_view_page/enable_hosts_view_page.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/enable_hosts_view_page/enable_hosts_view_page.tsx index ccdcb30e65821..d23a66916d70e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/enable_hosts_view_page/enable_hosts_view_page.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/enable_hosts_view_page/enable_hosts_view_page.tsx @@ -10,7 +10,7 @@ import { EuiPageTemplate, EuiImage, EuiSpacer } from '@elastic/eui'; import { css } from '@emotion/react'; import { useEuiBackgroundColor } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useUiSetting } from '@kbn/kibana-react-plugin/public'; import { MetricsPageTemplate } from '../../../page_template'; import hostsLandingBetaLight from './hosts_landing_beta_light.svg'; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx index 84148ef3fa3d4..1ca34c1cfc317 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/index.tsx @@ -7,7 +7,7 @@ import { EuiButton, EuiErrorBoundary } from '@elastic/eui'; import React from 'react'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { APP_WRAPPER_CLASS } from '@kbn/core/public'; import { FormattedMessage } from '@kbn/i18n-react'; import { css } from '@emotion/react'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx index bb3a92d1e04ea..133fd1d7fbffd 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx @@ -9,7 +9,7 @@ import React, { useCallback, useState, useEffect, useRef } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiPanel } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import useLocalStorage from 'react-use/lib/useLocalStorage'; import { InventoryItemType } from '../../../../../common/inventory_models/types'; import { TryItButton } from '../../../../components/try_it_button'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx index 0aecea0a8a879..ec3acc92c2d71 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx @@ -29,7 +29,7 @@ import { import { FormattedMessage, FormattedDate } from '@kbn/i18n-react'; import { withTheme } from '@kbn/kibana-react-plugin/common'; import { useLinkProps } from '@kbn/observability-plugin/public'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { datemathToEpochMillis } from '../../../../../../../utils/datemath'; import { SnapshotMetricType } from '../../../../../../../../common/inventory_models/types'; import { useSorting } from '../../../../../../../hooks/use_sorting'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx index 63e1b7de6deb6..2de3ee7bbb301 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx @@ -17,7 +17,7 @@ import moment, { Moment } from 'moment'; import { EuiComboBox } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { useUiTracker } from '@kbn/observability-plugin/public'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { useSourceContext } from '../../../../../../containers/metrics_source'; import { useMetricK8sModuleContext } from '../../../../../../containers/ml/modules/metrics_k8s/module'; import { useMetricHostsModuleContext } from '../../../../../../containers/ml/modules/metrics_hosts/module'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx index 6c97172a30f82..6258000b72adf 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary } from '@elastic/eui'; import React from 'react'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { APP_WRAPPER_CLASS } from '@kbn/core/public'; import { css } from '@emotion/react'; import { FilterBar } from './components/filter_bar'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx index 8d80caa91c87b..c8faac5327de9 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx @@ -8,7 +8,7 @@ import { EuiErrorBoundary } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useEffect, useState } from 'react'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { SourceLoadingPage } from '../../../components/source_loading_page'; import { useMetricsExplorerViews } from '../../../hooks/use_metrics_explorer_views'; import { MetricsSourceConfigurationProperties } from '../../../../common/metrics_sources'; diff --git a/x-pack/plugins/monitoring/kibana.jsonc b/x-pack/plugins/monitoring/kibana.jsonc index 0d1b906dcc4f4..236e6390d1bce 100644 --- a/x-pack/plugins/monitoring/kibana.jsonc +++ b/x-pack/plugins/monitoring/kibana.jsonc @@ -6,15 +6,14 @@ "id": "monitoring", "server": true, "browser": true, - "configPath": [ - "monitoring" - ], + "configPath": ["monitoring"], "requiredPlugins": [ "licensing", "features", "data", "navigation", "observability", + "observabilityShared", "dataViews", "unifiedSearch" ], @@ -30,10 +29,6 @@ "dashboard", "fleet" ], - "requiredBundles": [ - "kibanaUtils", - "alerting", - "kibanaReact" - ] + "requiredBundles": ["kibanaUtils", "alerting", "kibanaReact"] } } diff --git a/x-pack/plugins/monitoring/public/components/page_loading/index.tsx b/x-pack/plugins/monitoring/public/components/page_loading/index.tsx index ea1345fbce8ff..cb734fe8123fc 100644 --- a/x-pack/plugins/monitoring/public/components/page_loading/index.tsx +++ b/x-pack/plugins/monitoring/public/components/page_loading/index.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import './page_loading.scss'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; function PageLoadingUI() { return ( diff --git a/x-pack/plugins/monitoring/public/components/setup_mode/toggle_button.tsx b/x-pack/plugins/monitoring/public/components/setup_mode/toggle_button.tsx index f91641d942815..90d90075f1c49 100644 --- a/x-pack/plugins/monitoring/public/components/setup_mode/toggle_button.tsx +++ b/x-pack/plugins/monitoring/public/components/setup_mode/toggle_button.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-shared-plugin/public'; import { TELEMETRY_METRIC_BUTTON_CLICK } from '../../../common/constants'; import { SetupModeExitButton } from './exit_button'; diff --git a/x-pack/plugins/monitoring/tsconfig.json b/x-pack/plugins/monitoring/tsconfig.json index cccc6020d2d15..825e85e06b391 100644 --- a/x-pack/plugins/monitoring/tsconfig.json +++ b/x-pack/plugins/monitoring/tsconfig.json @@ -40,6 +40,7 @@ "@kbn/dashboard-plugin", "@kbn/fleet-plugin", "@kbn/shared-ux-router", + "@kbn/observability-shared-plugin", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/observability/public/components/app/observability_status/observability_status_box.tsx b/x-pack/plugins/observability/public/components/app/observability_status/observability_status_box.tsx index d734a39a3f5ee..ad05ba3a3b878 100644 --- a/x-pack/plugins/observability/public/components/app/observability_status/observability_status_box.tsx +++ b/x-pack/plugins/observability/public/components/app/observability_status/observability_status_box.tsx @@ -19,7 +19,7 @@ import { } from '@elastic/eui'; import React, { useCallback } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useUiTracker } from '../../../hooks/use_track_metric'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { useKibana } from '../../../utils/kibana_react'; export interface ObservabilityStatusBoxProps { diff --git a/x-pack/plugins/observability/public/components/app/observability_status/observability_status_progress.tsx b/x-pack/plugins/observability/public/components/app/observability_status/observability_status_progress.tsx index 29b44062adb88..53d0d13d0b2c4 100644 --- a/x-pack/plugins/observability/public/components/app/observability_status/observability_status_progress.tsx +++ b/x-pack/plugins/observability/public/components/app/observability_status/observability_status_progress.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useUiTracker } from '../../../hooks/use_track_metric'; +import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { useGuidedSetupProgress } from '../../../hooks/use_guided_setup_progress'; interface ObservabilityStatusProgressProps { diff --git a/x-pack/plugins/observability/public/hooks/use_track_metric.tsx b/x-pack/plugins/observability/public/hooks/use_track_metric.tsx deleted file mode 100644 index 7138c20ef6aa6..0000000000000 --- a/x-pack/plugins/observability/public/hooks/use_track_metric.tsx +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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. - */ - -import { useEffect, useMemo } from 'react'; -import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics'; -import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ObservabilityApp } from '../../typings/common'; - -/** - * Note: The usage_collection plugin will take care of sending this data to the telemetry server. - * You can find the metrics that are collected by these hooks in Stack Telemetry. - * Search the index `kibana-ui-counter`. You can filter for `eventName` and/or `appName`. - */ - -interface TrackOptions { - app?: ObservabilityApp; - metricType?: UiCounterMetricType; - delay?: number; // in ms -} -type EffectDeps = unknown[]; - -interface ServiceDeps { - usageCollection: UsageCollectionSetup; // TODO: This should really be start. Looking into it. -} - -export type TrackMetricOptions = TrackOptions & { metric: string }; -export type UiTracker = ReturnType; -export type TrackEvent = (options: TrackMetricOptions) => void; - -export { METRIC_TYPE }; - -export function useUiTracker({ - app: defaultApp, -}: { app?: ObservabilityApp } = {}): TrackEvent { - const reportUiCounter = useKibana().services?.usageCollection?.reportUiCounter; - const trackEvent = useMemo(() => { - return ({ app = defaultApp, metric, metricType = METRIC_TYPE.COUNT }: TrackMetricOptions) => { - if (reportUiCounter) { - reportUiCounter(app as string, metricType, metric); - } - }; - }, [defaultApp, reportUiCounter]); - return trackEvent; -} - -export function useTrackMetric( - { app, metric, metricType = METRIC_TYPE.COUNT, delay = 0 }: TrackMetricOptions, - effectDependencies: EffectDeps = [] -) { - const reportUiCounter = useKibana().services?.usageCollection?.reportUiCounter; - - useEffect(() => { - if (!reportUiCounter) { - // eslint-disable-next-line no-console - console.log( - 'usageCollection.reportUiCounter is unavailable. Ensure this is setup via .' - ); - } else { - let decoratedMetric = metric; - if (delay > 0) { - decoratedMetric += `__delayed_${delay}ms`; - } - const id = setTimeout( - () => reportUiCounter(app as string, metricType, decoratedMetric), - Math.max(delay, 0) - ); - return () => clearTimeout(id); - } - // the dependencies are managed externally - // eslint-disable-next-line react-hooks/exhaustive-deps - }, effectDependencies); -} - -/** - * useTrackPageview is a convenience wrapper for tracking a pageview - * Its metrics will be found at: - * stack_stats.kibana.plugins.ui_metric.{app}.pageview__{path}(__delayed_{n}ms)? - */ -type TrackPageviewProps = TrackOptions & { path: string }; - -export function useTrackPageview( - { path, ...rest }: TrackPageviewProps, - effectDependencies: EffectDeps = [] -) { - useTrackMetric({ ...rest, metric: `pageview__${path}` }, effectDependencies); -} diff --git a/x-pack/plugins/observability/public/index.ts b/x-pack/plugins/observability/public/index.ts index 5a8f24ba61988..4cfb6fbcca43a 100644 --- a/x-pack/plugins/observability/public/index.ts +++ b/x-pack/plugins/observability/public/index.ts @@ -60,14 +60,6 @@ export { export type { LazyObservabilityPageTemplateProps } from './components/shared'; -export type { UiTracker, TrackMetricOptions } from './hooks/use_track_metric'; -export { - useTrackPageview, - useUiTracker, - useTrackMetric, - METRIC_TYPE, -} from './hooks/use_track_metric'; - export const LazyAlertsFlyout = lazy(() => import('./components/alerts_flyout')); export { useFetcher, FETCH_STATUS } from './hooks/use_fetcher'; export { useEsSearch, createEsParams } from './hooks/use_es_search'; diff --git a/x-pack/plugins/observability/public/pages/overview/helpers/use_overview_metrics.ts b/x-pack/plugins/observability/public/pages/overview/helpers/use_overview_metrics.ts index fc92052ac77c5..b2047fe02dec3 100644 --- a/x-pack/plugins/observability/public/pages/overview/helpers/use_overview_metrics.ts +++ b/x-pack/plugins/observability/public/pages/overview/helpers/use_overview_metrics.ts @@ -7,9 +7,8 @@ import { useEffect } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { useUiTracker, useTrackPageview } from '@kbn/observability-shared-plugin/public'; -import { useTrackPageview } from '../../..'; -import { useUiTracker } from '../../../hooks/use_track_metric'; import { ObservabilityAppServices } from '../../../application/types'; const CAPABILITIES_KEYS = ['logs', 'infrastructure', 'apm', 'uptime']; diff --git a/x-pack/plugins/observability/tsconfig.json b/x-pack/plugins/observability/tsconfig.json index 016404e8d9d58..3703bb6ea7c7c 100644 --- a/x-pack/plugins/observability/tsconfig.json +++ b/x-pack/plugins/observability/tsconfig.json @@ -43,7 +43,6 @@ "@kbn/utility-types", "@kbn/es-types", "@kbn/rison", - "@kbn/analytics", "@kbn/datemath", "@kbn/core-ui-settings-browser", "@kbn/es-query", diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx index 58a2dd97844e9..adfcc028ffe48 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { getServiceLocations, selectServiceLocationsState } from '../../state'; import { ServiceAllowedWrapper } from '../common/wrappers/service_allowed_wrapper'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.test.tsx index 6b45a7d3920c2..0cddf9d760737 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.test.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.test.tsx @@ -11,7 +11,7 @@ import { render } from '../../utils/testing/rtl_helpers'; import { MonitorEditPage } from './monitor_edit_page'; import { ConfigKey } from '../../../../../common/runtime_types'; -import * as observabilityPublic from '@kbn/observability-plugin/public'; +import * as observabilityPublic from '@kbn/observability-shared-plugin/public'; import { PROFILE_VALUES_ENUM, PROFILES_MAP, @@ -19,7 +19,7 @@ import { mockGlobals(); -jest.mock('@kbn/observability-plugin/public'); +jest.mock('@kbn/observability-shared-plugin/public'); jest.mock('@kbn/kibana-react-plugin/public', () => { const original = jest.requireActual('@kbn/kibana-react-plugin/public'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.tsx index b77b799a49041..214b2c86f2695 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.tsx @@ -10,7 +10,7 @@ import { useParams } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import { EuiEmptyPrompt } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useTrackPageview, useFetcher } from '@kbn/observability-plugin/public'; +import { useTrackPageview, useFetcher } from '@kbn/observability-shared-plugin/public'; import { IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; import { EditMonitorNotFound } from './edit_monitor_not_found'; import { LoadingState } from '../monitors_page/overview/overview/monitor_detail_flyout'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/monitors_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/monitors_page.tsx index f8714f668dd93..d63c713341850 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/monitors_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/monitors_page.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { Redirect } from 'react-router-dom'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { DisabledCallout } from './management/disabled_callout'; import { useOverviewStatus } from './hooks/use_overview_status'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx index 2e4eb6ca03a31..d5e2b5fb9505e 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react'; import { EuiFlexGroup, EuiSpacer, EuiFlexItem } from '@elastic/eui'; import { useDispatch, useSelector } from 'react-redux'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { Redirect, useLocation } from 'react-router-dom'; import { DisabledCallout } from '../management/disabled_callout'; import { FilterGroup } from '../common/monitor_filters/filter_group'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx index bccfb041066a3..190036a55fccf 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react'; import { useParams } from 'react-router-dom'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer } from '@elastic/eui'; import { useDispatch } from 'react-redux'; import { ErrorCallOut } from './error_callout'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.tsx index 2091d02f499d2..3338f8ec57a51 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.tsx @@ -18,7 +18,7 @@ import { EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-shared-plugin/public'; import { Table } from './waterfall_flyout_table'; import { MiddleTruncatedText } from '../middle_truncated_text'; import { WaterfallMetadataEntry } from '../../../common/network_data/types'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.tsx index e57dfa32ad4f7..4370d1191f5b0 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFieldSearch, EuiFlexGroup, EuiText, useEuiTheme } from '@elastic/eui'; import useDebounce from 'react-use/lib/useDebounce'; -import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-shared-plugin/public'; import { FILTER_REQUESTS_LABEL, SEARCH_REQUESTS_LABEL } from '../translations'; import { NetworkRequestsTotal } from './network_requests_total'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx index 2129db378b5dc..38046601d934a 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx @@ -7,7 +7,7 @@ import React, { memo, useCallback } from 'react'; import { PackagePolicyCreateExtensionComponentProps } from '@kbn/fleet-plugin/public'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { DeprecateNoticeModal } from './deprecate_notice_modal'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx index 0849832107aeb..669d615dd6479 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useMemo, useState } from 'react'; import { EuiHealth } from '@elastic/eui'; -import { useTrackMetric, METRIC_TYPE } from '@kbn/observability-plugin/public'; +import { useTrackMetric, METRIC_TYPE } from '@kbn/observability-shared-plugin/public'; import { getSeriesAndDomain, getSidebarItems, getLegendItems } from './data_formatting'; import { SidebarItem, LegendItem, NetworkItems } from './types'; import { WaterfallProvider, WaterfallChart, RenderItem, useFlyout } from '../../waterfall'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx index fea41faf8e37f..9480811836800 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx @@ -18,7 +18,7 @@ import { EuiSpacer, } from '@elastic/eui'; import useDebounce from 'react-use/lib/useDebounce'; -import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-shared-plugin/public'; import { FILTER_REQUESTS_LABEL, FILTER_SCREENREADER_LABEL, diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx index 4c78010e9c4e6..cdce5b1785983 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx @@ -18,7 +18,7 @@ import { EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-shared-plugin/public'; import { Table } from '../../waterfall/components/waterfall_flyout_table'; import { MiddleTruncatedText } from '../../waterfall'; import { WaterfallMetadataEntry } from '../../waterfall/types'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/pages/certificates.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/certificates.tsx index 7b6a4d5e735e3..bda9526dd5b5f 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/pages/certificates.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/certificates.tsx @@ -8,7 +8,7 @@ import { useDispatch } from 'react-redux'; import { EuiSpacer } from '@elastic/eui'; import React, { useEffect, useState } from 'react'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; import { getDynamicSettings } from '../state/actions/dynamic_settings'; import { CertificateList, CertificateSearch, CertSort } from '../components/certificates'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/pages/mapping_error.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/mapping_error.tsx index db403eb0dcd97..66b8c1404842a 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/pages/mapping_error.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/mapping_error.tsx @@ -12,7 +12,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; export const MappingErrorPage = () => { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor.tsx index 3abde2d0db1c9..732f5f22cc177 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor.tsx @@ -8,7 +8,7 @@ import { EuiSpacer } from '@elastic/eui'; import React, { useEffect } from 'react'; import { useDispatch } from 'react-redux'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useMonitorId } from '../hooks'; import { MonitorCharts } from '../components/monitor'; import { MonitorStatusDetails, PingList } from '../components/monitor'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/pages/overview.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/overview.tsx index 88d292a7e06cd..f36ffd100b3ed 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/pages/overview.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/overview.tsx @@ -9,7 +9,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; import { MonitorList } from '../components/overview/monitor_list/monitor_list_container'; import { IntegrationDeprecation } from '../components/overview/integration_deprecation'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/step_detail_page.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/step_detail_page.tsx index 7caa521e434f4..c6659c2173571 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/step_detail_page.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/step_detail_page.tsx @@ -8,7 +8,7 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import { useHistory, useParams } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; import { useInitApp } from '../../hooks/use_init_app'; import { StepDetailContainer } from '../../components/monitor/synthetics/step_detail/step_detail_container'; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx index cc0df9b4c1687..e08c8054fcbdc 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { useInitApp } from '../../hooks/use_init_app'; import { StepsList } from '../../components/synthetics/check_steps/steps_list'; import { useCheckSteps } from '../../components/synthetics/check_steps/use_check_steps'; diff --git a/x-pack/plugins/ux/public/components/app/rum_dashboard/index.tsx b/x-pack/plugins/ux/public/components/app/rum_dashboard/index.tsx index a8af8fad43231..79af9fd76de44 100644 --- a/x-pack/plugins/ux/public/components/app/rum_dashboard/index.tsx +++ b/x-pack/plugins/ux/public/components/app/rum_dashboard/index.tsx @@ -7,7 +7,7 @@ import { EuiSpacer } from '@elastic/eui'; import React from 'react'; -import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { LocalUIFilters } from './local_uifilters'; import { RumDashboard } from './rum_dashboard';