Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Observability] New "No Data" screens #107709

Merged
merged 102 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
202fba7
Initial commit of new NoDataPage and accompanying cards
Aug 4, 2021
e6c1290
Adding to Security Solution and forcing view in TemplateWrapper
Aug 4, 2021
0ac66b8
Center page
Aug 4, 2021
5274c96
Better customizations & sorting on `recommended`
Aug 5, 2021
66445f8
Adding custom size to Solution Nav Avatar for reuse and working on pa…
Aug 5, 2021
495e905
Put SetupGuideCTA back
Aug 5, 2021
4600e9a
Fix TS
Aug 5, 2021
80e2063
Added empty state to Infra/Logs
Aug 5, 2021
d7c2e29
Added to APM
Aug 5, 2021
4563cad
Added to Metrics template
Aug 5, 2021
b774ecb
Added to Uptime and fixed layouts
Aug 5, 2021
b2ce1c3
Fixing UX layout
Aug 5, 2021
5f98d10
Merge remote-tracking branch 'upstream/master' into design/add_data_s…
Aug 5, 2021
ab8c4bd
Faked in for UX
Aug 5, 2021
c981540
Removing outer template from no data page
Aug 5, 2021
549ee0a
Optimizing some prop usages
Aug 6, 2021
8c0acc4
Making `noDataConfig` a view in KibanaPageTemplate
Aug 6, 2021
67c7b6a
Working on links
Aug 6, 2021
6e4e53b
Obs Getting Started page (without solution nav)
Aug 9, 2021
7850037
Cleanup
Aug 9, 2021
a0128dd
Fix i18n
Aug 9, 2021
0f3b96b
Dev docs
Aug 9, 2021
b3152c6
Only one link for solutions
snide Aug 11, 2021
23ad9ac
Fix double templates in Uptime
Aug 11, 2021
6fe3a39
Move styles to page contents Sass file and only add min width when th…
Aug 11, 2021
a5defa0
cleanup
Aug 11, 2021
3e6d656
Adding tests to template.
Aug 11, 2021
31676e3
Removing a few hard-coded checks to test tests
Aug 11, 2021
fbf3267
Actually fix tests for cards
Aug 11, 2021
20b0e4e
i18n
Aug 11, 2021
d3fdc9e
Merge branch 'master' into design/add_data_screens
cchaos Aug 11, 2021
c13cfe3
Merge branch 'elastic:master' into design/add_data_screens
cchaos Aug 12, 2021
76da749
Merge remote-tracking branch 'upstream/master' into design/add_data_s…
Aug 13, 2021
64661d7
Rebase fixes
Aug 13, 2021
7e3e60a
Mroe rebase fixes, cleanup, and links
Aug 13, 2021
57a66d6
Merge branch 'master' into design/add_data_screens
cchaos Aug 13, 2021
81a444b
Fix ES test
Aug 13, 2021
da83c6c
Skipping security solution test for now
Aug 13, 2021
82d2f40
Hopefully fixing some tests
Aug 13, 2021
9bc06ae
Merge remote-tracking branch 'upstream/master' into design/add_data_s…
Aug 14, 2021
82e5649
Revert "Skipping security solution test for now"
Aug 16, 2021
3be7b0d
Revert "Adding to Security Solution and forcing view in TemplateWrapper"
Aug 16, 2021
255acbe
More Security Solution reverts
Aug 16, 2021
f957968
Merge branch 'master' into design/add_data_screens
cchaos Aug 16, 2021
33f922f
Update beats card default text to just `Add data`
Aug 16, 2021
ab018d7
Updated RUM copy
Aug 16, 2021
54d0d49
Updating Uptime copy
Aug 16, 2021
5c852fb
Update APM copy
Aug 16, 2021
6e9c8ce
Updating Logs copy and reverting changes to `page_no_indices_content`…
Aug 16, 2021
25e711a
Updated copy for Metrics
Aug 16, 2021
4f0613c
Updated copy for landing and overview pages
Aug 16, 2021
7ef38f3
[ElasticBeatsCard] Reuse `title` as default button label
Aug 16, 2021
2e9346f
Better SS revert
Aug 16, 2021
d041c81
`agent` not `Agent`
Aug 16, 2021
bd8d2b1
Merge branch 'master' into design/add_data_screens
cchaos Aug 18, 2021
7cd45fc
Merge branch 'master' into design/add_data_screens
cchaos Aug 25, 2021
683c1f1
logic to show no data screen
cauemarcondes Sep 8, 2021
26fcbbf
Merge pull request #31 from cauemarcondes/apm-new-no-data-screen
cchaos Sep 8, 2021
a9f9989
Merge remote-tracking branch upstream/master into design/add_data_scr…
Sep 8, 2021
a72d42e
i18n
Sep 8, 2021
4f233c1
Merge remote-tracking branch 'upstream/master' into design/add_data_s…
Sep 9, 2021
30f86a8
Merge branch 'master' into design/add_data_screens
cchaos Sep 13, 2021
5f39a8f
Fixing bad rebase in APM template
cchaos Sep 13, 2021
b92fca9
Delete historical_data.ts
cchaos Sep 13, 2021
33dc8dc
Fix from rebase to Overview page
cchaos Sep 13, 2021
1276d50
Merge branch 'master' into design/add_data_screens
cchaos Sep 16, 2021
604f590
Fix RumHome from rebase
cchaos Sep 16, 2021
fdd84aa
Use KibanaPageTemplateProps
cchaos Sep 17, 2021
f6cc266
Merge branch 'master' into design/add_data_screens
cchaos Sep 20, 2021
30b7d6f
Add `hasData` prop to `LogsPageTemplate`
Sep 21, 2021
edf7e97
Check for data in log pages
Sep 21, 2021
8921313
Add `hasData` prop to `MetricsPageTemplate`
Sep 21, 2021
89c16eb
Check for data in metrics pages
Sep 21, 2021
e4a5a23
Merge branch 'master' into design/add_data_screens
cchaos Sep 21, 2021
6c7d151
Fix bad rebase to routes
cchaos Sep 21, 2021
1493eab
Add test subject to no data screen
Sep 22, 2021
bbfc4e5
Fix log entry categories tab test
Sep 22, 2021
fa13307
Fix infrastructure_security test
Sep 22, 2021
9d6e9af
Remove hard-coded DTS on NoDataPage and ensure one is passed through …
Sep 22, 2021
0372ce0
Fix lint error
Sep 22, 2021
9aad198
Merge branch 'master' into design/add_data_screens
kibanamachine Sep 22, 2021
cc4ae52
Remove DTS test 🤦‍♀️
Sep 22, 2021
bc2b3f4
enable no data view on tls certificate route
shahzad31 Sep 22, 2021
45b0070
Fix uptime page layout
Sep 22, 2021
d5fc41f
Remove unnecessary check for the metrics settings page
Sep 27, 2021
6c5823e
Merge branch 'master' into design/add_data_screens
kibanamachine Sep 28, 2021
b6f42aa
Merge branch 'master' into design/add_data_screens
kibanamachine Sep 30, 2021
847fec7
Fix metrics no indices test
Oct 1, 2021
d2fbe0f
Fix more tests
Oct 1, 2021
e976f05
Fix logEntryRate test
Oct 4, 2021
a6507b2
Fix spaces tests
Oct 4, 2021
f0142d9
Merge branch 'master' of github.com:elastic/kibana into design/add_da…
shahzad31 Oct 4, 2021
6923af0
Merge branch 'master' into design/add_data_screens
kibanamachine Oct 4, 2021
94cc373
update timeout
shahzad31 Oct 5, 2021
83b50e0
Fix even more tests
Oct 5, 2021
1a9bf58
update test
shahzad31 Oct 5, 2021
7ac8c56
Fix test for new index patterns
Oct 5, 2021
87d5be8
Merge branch 'master' into design/add_data_screens
cchaos Oct 5, 2021
9461716
Merge branch 'master' into design/add_data_screens
kibanamachine Oct 5, 2021
b3164c5
Merge branch 'master' into design/add_data_screens
kibanamachine Oct 6, 2021
69abe1d
Merge branch 'master' into design/add_data_screens
kibanamachine Oct 6, 2021
0707c30
remove uptime flaky test
shahzad31 Oct 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const KibanaPageTemplate: FunctionComponent<KibanaPageTemplateProps> = ({
if (noDataConfig) {
return (
<EuiPageTemplate
data-test-subj={rest['data-test-subj']}
template={template}
className={classes}
pageSideBar={pageSideBar}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
* 2.0.
*/

import { EuiPageHeaderProps, EuiPageTemplateProps } from '@elastic/eui';
import { EuiPageHeaderProps } from '@elastic/eui';
import React from 'react';
import { useLocation } from 'react-router-dom';
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public';
import {
useKibana,
KibanaPageTemplateProps,
} from '../../../../../../../src/plugins/kibana_react/public';
import { useFetcher } from '../../../hooks/use_fetcher';
import { ApmPluginStartDeps } from '../../../plugin';
import { ApmEnvironmentFilter } from '../../shared/EnvironmentFilter';
Expand All @@ -35,7 +38,7 @@ export function ApmMainTemplate({
pageTitle?: React.ReactNode;
pageHeader?: EuiPageHeaderProps;
children: React.ReactNode;
} & EuiPageTemplateProps) {
} & KibanaPageTemplateProps) {
const location = useLocation();

const { services } = useKibana<ApmPluginStartDeps>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { LogEntryCategoriesResultsContent } from './page_results_content';
import { LogEntryCategoriesSetupContent } from './page_setup_content';
import { LogsPageTemplate } from '../page_template';
import type { LazyObservabilityPageTemplateProps } from '../../../../../observability/public';
import { useLogSourceContext } from '../../../containers/logs/log_source';

const logCategoriesTitle = i18n.translate('xpack.infra.logs.logCategoriesTitle', {
defaultMessage: 'Categories',
Expand Down Expand Up @@ -114,8 +115,10 @@ const CategoriesPageTemplate: React.FC<LazyObservabilityPageTemplateProps> = ({
children,
...rest
}) => {
const { sourceStatus } = useLogSourceContext();
return (
<LogsPageTemplate
hasData={sourceStatus?.logIndexStatus !== 'missing'}
data-test-subj="logsLogEntryCategoriesPage"
pageHeader={
rest.isEmptyState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { RecreateJobButton } from '../../../components/logging/log_analysis_setu
import { AnalyzeInMlButton } from '../../../components/logging/log_analysis_results';
import { useMlHref, ML_PAGES } from '../../../../../ml/public';
import { DatasetsSelector } from '../../../components/logging/log_analysis_results/datasets_selector';
import { useLogSourceContext } from '../../../containers/logs/log_source';
import { MLJobsAwaitingNodeWarning } from '../../../../../ml/public';

const JOB_STATUS_POLLING_INTERVAL = 30000;
Expand All @@ -50,6 +51,7 @@ export const LogEntryCategoriesResultsContent: React.FunctionComponent<LogEntryC
services: { ml, http },
} = useKibanaContextForPlugin();

const { sourceStatus } = useLogSourceContext();
const { hasLogAnalysisSetupCapabilities } = useLogAnalysisCapabilitiesContext();

const {
Expand Down Expand Up @@ -211,6 +213,7 @@ export const LogEntryCategoriesResultsContent: React.FunctionComponent<LogEntryC
endTimestamp={categoryQueryTimeRange.timeRange.endTime}
>
<LogsPageTemplate
hasData={sourceStatus?.logIndexStatus !== 'missing'}
pageHeader={{
pageTitle,
rightSideItems: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
useLogAnalysisSetupFlyoutStateContext,
} from '../../../components/logging/log_analysis_setup/setup_flyout';
import { SubscriptionSplashPage } from '../../../components/subscription_splash_content';
import { useLogSourceContext } from '../../../containers/logs/log_source';
import { useLogAnalysisCapabilitiesContext } from '../../../containers/logs/log_analysis';
import { useLogEntryCategoriesModuleContext } from '../../../containers/logs/log_analysis/modules/log_entry_categories';
import { useLogEntryRateModuleContext } from '../../../containers/logs/log_analysis/modules/log_entry_rate';
Expand Down Expand Up @@ -155,8 +156,10 @@ const AnomaliesPageTemplate: React.FC<LazyObservabilityPageTemplateProps> = ({
children,
...rest
}) => {
const { sourceStatus } = useLogSourceContext();
return (
<LogsPageTemplate
hasData={sourceStatus?.logIndexStatus !== 'missing'}
data-test-subj="logsLogEntryRatePage"
pageHeader={
rest.isEmptyState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const LogEntryRateResultsContent: React.FunctionComponent<{

const navigateToApp = useKibana().services.application?.navigateToApp;

const { sourceId } = useLogSourceContext();
const { sourceId, sourceStatus } = useLogSourceContext();

const { hasLogAnalysisSetupCapabilities } = useLogAnalysisCapabilitiesContext();

Expand Down Expand Up @@ -196,6 +196,7 @@ export const LogEntryRateResultsContent: React.FunctionComponent<{

return (
<LogsPageTemplate
hasData={sourceStatus?.logIndexStatus !== 'missing'}
pageHeader={{
pageTitle,
rightSideItems: [<ManageJobsButton onClick={showModuleList} size="s" />],
Expand Down
50 changes: 46 additions & 4 deletions x-pack/plugins/infra/public/pages/logs/page_template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,61 @@
*/

import React from 'react';
import { i18n } from '@kbn/i18n';
import { useKibanaContextForPlugin } from '../../hooks/use_kibana';
import type { LazyObservabilityPageTemplateProps } from '../../../../observability/public';
import {
KibanaPageTemplateProps,
useKibana,
} from '../../../../../../src/plugins/kibana_react/public';

export const LogsPageTemplate: React.FC<LazyObservabilityPageTemplateProps> = (
pageTemplateProps
) => {
interface LogsPageTemplateProps extends LazyObservabilityPageTemplateProps {
hasData?: boolean;
}

export const LogsPageTemplate: React.FC<LogsPageTemplateProps> = ({
hasData = true,
'data-test-subj': _dataTestSubj,
...pageTemplateProps
}) => {
const {
services: {
observability: {
navigation: { PageTemplate },
},
docLinks,
},
} = useKibanaContextForPlugin();

return <PageTemplate {...pageTemplateProps} />;
const { http } = useKibana().services;
const basePath = http!.basePath.get();

const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = hasData
? undefined
: {
solution: i18n.translate('xpack.infra.logs.noDataConfig.solutionName', {
defaultMessage: 'Observability',
}),
actions: {
beats: {
title: i18n.translate('xpack.infra.logs.noDataConfig.beatsCard.title', {
defaultMessage: 'Add logs with Beats',
}),
description: i18n.translate('xpack.infra.logs.noDataConfig.beatsCard.description', {
defaultMessage:
'Use Beats to send logs to Elasticsearch. We make it easy with modules for many popular systems and apps.',
}),
href: basePath + `/app/home#/tutorial_directory/logging`,
},
},
docsLink: docLinks.links.observability.guide,
};

return (
<PageTemplate
data-test-subj={hasData ? _dataTestSubj : 'noDataPage'}
noDataConfig={noDataConfig}
{...pageTemplateProps}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { LogSourceErrorPage } from '../../../components/logging/log_source_error
import { SourceLoadingPage } from '../../../components/source_loading_page';
import { useLogSourceContext } from '../../../containers/logs/log_source';
import { LogsPageLogsContent } from './page_logs_content';
import { LogsPageNoIndicesContent } from './page_no_indices_content';
import { LogsPageTemplate } from '../page_template';
import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common';
import { APP_WRAPPER_CLASS } from '../../../../../../../src/core/public';
Expand All @@ -34,10 +33,11 @@ export const StreamPageContent: React.FunctionComponent = () => {
return <SourceLoadingPage />;
} else if (hasFailedLoading) {
return <LogSourceErrorPage errors={latestLoadSourceFailures} onRetry={loadSource} />;
} else if (sourceStatus?.logIndexStatus !== 'missing') {
} else {
return (
<LogStreamPageWrapper className={APP_WRAPPER_CLASS}>
<LogsPageTemplate
hasData={sourceStatus?.logIndexStatus !== 'missing'}
pageHeader={{
pageTitle: streamTitle,
}}
Expand All @@ -46,8 +46,6 @@ export const StreamPageContent: React.FunctionComponent = () => {
</LogsPageTemplate>
</LogStreamPageWrapper>
);
} else {
return <LogsPageNoIndicesContent />;
}
};

Expand Down
51 changes: 3 additions & 48 deletions x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
* 2.0.
*/

import { EuiButton, EuiErrorBoundary, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EuiErrorBoundary } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useContext } from 'react';
import { FilterBar } from './components/filter_bar';

import { DocumentTitle } from '../../../components/document_title';
import { NoIndices } from '../../../components/empty_states/no_indices';

import { SourceErrorPage } from '../../../components/source_error_page';
import { SourceLoadingPage } from '../../../components/source_loading_page';
import { ViewSourceConfigurationButton } from '../../../components/source_configuration/view_source_configuration_button';
import { Source } from '../../../containers/metrics_source';
import { useTrackPageview } from '../../../../../observability/public';
import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs';
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public';
import { LayoutView } from './components/layout_view';
import { useLinkProps } from '../../../hooks/use_link_props';
import { SavedViewProvider } from '../../../containers/saved_view/saved_view';
import { DEFAULT_WAFFLE_VIEW_STATE } from './hooks/use_waffle_view_state';
import { useWaffleOptionsContext } from './hooks/use_waffle_options';
Expand All @@ -32,7 +28,6 @@ import { inventoryTitle } from '../../../translations';
import { SavedViews } from './components/saved_views';

export const SnapshotPage = () => {
const uiCapabilities = useKibana().services.application?.capabilities;
const {
hasFailedLoadingSource,
isLoading,
Expand All @@ -45,11 +40,6 @@ export const SnapshotPage = () => {
useTrackPageview({ app: 'infra_metrics', path: 'inventory', delay: 15000 });
const { source: optionsSource } = useWaffleOptionsContext();

const tutorialLinkProps = useLinkProps({
app: 'home',
hash: '/tutorial_directory/metrics',
});

useMetricsBreadcrumbs([
{
text: inventoryTitle,
Expand Down Expand Up @@ -79,6 +69,7 @@ export const SnapshotPage = () => {
defaultViewState={DEFAULT_WAFFLE_VIEW_STATE}
>
<MetricsPageTemplate
hasData={metricIndicesExist}
pageHeader={{
pageTitle: inventoryTitle,
rightSideItems: [<SavedViews />],
Expand All @@ -96,43 +87,7 @@ export const SnapshotPage = () => {
) : hasFailedLoadingSource ? (
<SourceErrorPage errorMessage={loadSourceFailureMessage || ''} retry={loadSource} />
) : (
<NoIndices
title={i18n.translate('xpack.infra.homePage.noMetricsIndicesTitle', {
defaultMessage: "Looks like you don't have any metrics indices.",
})}
message={i18n.translate('xpack.infra.homePage.noMetricsIndicesDescription', {
defaultMessage: "Let's add some!",
})}
actions={
<EuiFlexGroup>
<EuiFlexItem>
<EuiButton
{...tutorialLinkProps}
color="primary"
fill
data-test-subj="infrastructureViewSetupInstructionsButton"
>
{i18n.translate('xpack.infra.homePage.noMetricsIndicesInstructionsActionLabel', {
defaultMessage: 'View setup instructions',
})}
</EuiButton>
</EuiFlexItem>
{uiCapabilities?.infrastructure?.configureSource ? (
<EuiFlexItem>
<ViewSourceConfigurationButton
app="metrics"
data-test-subj="configureSourceButton"
>
{i18n.translate('xpack.infra.configureSourceActionLabel', {
defaultMessage: 'Change source configuration',
})}
</ViewSourceConfigurationButton>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
}
data-test-subj="noMetricsIndicesPrompt"
/>
<MetricsPageTemplate hasData={metricIndicesExist} data-test-subj="noMetricsIndicesPrompt" />
)}
</EuiErrorBoundary>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
* 2.0.
*/

import React, { useCallback, useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState, useContext } from 'react';
import dateMath from '@elastic/datemath';
import moment from 'moment';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { Source } from '../../../../containers/metrics_source';
import { InventoryMetric, InventoryItemType } from '../../../../../common/inventory_models/types';
import { useNodeDetails } from '../hooks/use_node_details';
import { MetricsSideNav } from './side_nav';
Expand Down Expand Up @@ -52,6 +53,7 @@ const parseRange = (range: MetricsTimeInput) => {
};

export const NodeDetailsPage = (props: Props) => {
const { metricIndicesExist } = useContext(Source.Context);
const [parsedTimeRange, setParsedTimeRange] = useState(parseRange(props.timeRange));
const { metrics, loading, makeRequest, error } = useNodeDetails(
props.requiredMetrics,
Expand Down Expand Up @@ -80,6 +82,7 @@ export const NodeDetailsPage = (props: Props) => {

return (
<MetricsPageTemplate
hasData={metricIndicesExist}
pageHeader={{
pageTitle: props.name,
rightSideItems: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const MetricDetail = withMetricPageProviders(
const nodeId = match.params.node;
const nodeType = match.params.type as InventoryItemType;
const inventoryModel = findInventoryModel(nodeType);
const { sourceId } = useContext(Source.Context);
const { sourceId, metricIndicesExist } = useContext(Source.Context);

const {
timeRange,
Expand Down Expand Up @@ -86,7 +86,7 @@ export const MetricDetail = withMetricPageProviders(

if (metadataLoading && !filteredRequiredMetrics.length) {
return (
<MetricsPageTemplate>
<MetricsPageTemplate hasData={metricIndicesExist}>
<InfraLoadingPanel
height="100vh"
width="100%"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

import { EuiErrorBoundary } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useEffect } from 'react';
import React, { useEffect, useContext } from 'react';
import { IIndexPattern } from 'src/plugins/data/public';
import { MetricsSourceConfigurationProperties } from '../../../../common/metrics_sources';
import { useTrackPageview } from '../../../../../observability/public';
import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs';

import { DocumentTitle } from '../../../components/document_title';
import { NoData } from '../../../components/empty_states';
import { MetricsExplorerCharts } from './components/charts';
import { MetricsExplorerToolbar } from './components/toolbar';
import { useMetricsExplorerState } from './hooks/use_metric_explorer_state';
import { Source } from '../../../containers/metrics_source';
import { useSavedViewContext } from '../../../containers/saved_view/saved_view';
import { MetricsPageTemplate } from '../page_template';
import { metricsExplorerTitle } from '../../../translations';
Expand Down Expand Up @@ -52,6 +52,7 @@ export const MetricsExplorerPage = ({ source, derivedIndexPattern }: MetricsExpl
useTrackPageview({ app: 'infra_metrics', path: 'metrics_explorer' });
useTrackPageview({ app: 'infra_metrics', path: 'metrics_explorer', delay: 15000 });

const { metricIndicesExist } = useContext(Source.Context);
useEffect(() => {
if (currentView) {
onViewStateChange(currentView);
Expand Down Expand Up @@ -85,6 +86,7 @@ export const MetricsExplorerPage = ({ source, derivedIndexPattern }: MetricsExpl
}
/>
<MetricsPageTemplate
hasData={metricIndicesExist}
pageHeader={{
pageTitle: metricsExplorerTitle,
rightSideItems: [
Expand Down
Loading