Skip to content

Commit

Permalink
[INFRA] Add additional perf telemetry (#205955)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-b authored Jan 10, 2025
1 parent 3b42b80 commit c7e4249
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import type { HostNodeRow } from '../hooks/use_hosts_table';
import { useHostsTableContext } from '../hooks/use_hosts_table';
import { useHostsViewContext } from '../hooks/use_hosts_view';
import { useHostCountContext } from '../hooks/use_host_count';
import { useUnifiedSearchContext } from '../hooks/use_unified_search';
import { FlyoutWrapper } from './host_details_flyout/flyout_wrapper';
import { DEFAULT_PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../constants';
import { FilterAction } from './table/filter_action';
import { useUnifiedSearchContext } from '../hooks/use_unified_search';

export const HostsTable = () => {
const { loading } = useHostsViewContext();
Expand All @@ -44,6 +44,10 @@ export const HostsTable = () => {
useEffect(() => {
if (!loading && !hostCountLoading) {
onPageReady({
meta: {
rangeFrom: searchCriteria.dateRange.from,
rangeTo: searchCriteria.dateRange.to,
},
customMetrics: {
key1: 'num_of_hosts',
value1: count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { i18n } from '@kbn/i18n';
import React, { useEffect, useState } from 'react';
import { useTrackPageview, FeatureFeedbackButton } from '@kbn/observability-shared-plugin/public';
import { usePerformanceContext } from '@kbn/ebt-tools';
import { OnboardingFlow } from '../../../components/shared/templates/no_data_config';
import { InfraPageTemplate } from '../../../components/shared/templates/infra_page_template';
import { WithMetricsExplorerOptionsUrlState } from '../../../containers/metrics_explorer/with_metrics_explorer_options_url_state';
Expand Down Expand Up @@ -65,6 +66,8 @@ const MetricsExplorerContent = () => {

const { kibanaVersion, isCloudEnv, isServerlessEnv } = useKibanaEnvironmentContext();

const { onPageReady } = usePerformanceContext();

useTrackPageview({ app: 'infra_metrics', path: 'metrics_explorer' });
useTrackPageview({ app: 'infra_metrics', path: 'metrics_explorer', delay: 15000 });

Expand Down Expand Up @@ -93,6 +96,15 @@ const MetricsExplorerContent = () => {
currentTimerange: timeRange,
};

if (!isLoading) {
onPageReady({
meta: {
rangeFrom: timeRange.from,
rangeTo: timeRange.to,
},
});
}

return (
<InfraPageTemplate
onboardingFlow={OnboardingFlow.Infra}
Expand Down

0 comments on commit c7e4249

Please sign in to comment.