forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Profiling] Empty state (elastic#172295)
The empty state will show up when `has_setup` from the Profiling Status API returns `false`. <img width="1276" alt="Screenshot 2023-11-30 at 15 06 30" src="https://github.com/elastic/kibana/assets/55978943/97a313be-db4f-4a5a-af36-df574f9793d5"> <img width="1036" alt="Screenshot 2023-11-30 at 14 47 48" src="https://github.com/elastic/kibana/assets/55978943/2622cad6-6763-4abc-9469-fa292137efda">
- Loading branch information
1 parent
a29b0f4
commit 4a308c6
Showing
10 changed files
with
182 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
x-pack/plugins/infra/public/components/asset_details/hooks/use_profiling_status_data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* 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 type { ProfilingStatus } from '@kbn/profiling-utils'; | ||
import { useEffect } from 'react'; | ||
import { useHTTPRequest } from '../../../hooks/use_http_request'; | ||
import { useRequestObservable } from './use_request_observable'; | ||
|
||
interface Props { | ||
isActive: boolean; | ||
} | ||
|
||
export function useProfilingStatusData({ isActive }: Props) { | ||
const { request$ } = useRequestObservable<ProfilingStatus>(); | ||
const { loading, error, response, makeRequest } = useHTTPRequest<ProfilingStatus>( | ||
`/api/infra/profiling/status`, | ||
'GET', | ||
undefined, | ||
undefined, | ||
undefined, | ||
undefined, | ||
true | ||
); | ||
|
||
useEffect(() => { | ||
if (!isActive) { | ||
return; | ||
} | ||
|
||
request$.next(makeRequest); | ||
}, [isActive, makeRequest, request$]); | ||
|
||
return { | ||
loading, | ||
error, | ||
response, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
x-pack/plugins/observability_shared/public/components/profiling/profiling_empty_state.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* 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 { EuiButton, EuiEmptyPrompt, EuiImage, EuiLink } from '@elastic/eui'; | ||
import { useKibana } from '@kbn/kibana-react-plugin/public'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React from 'react'; | ||
import profilingImg from '../../images/profiling.png'; | ||
|
||
export function ProfilingEmptyState() { | ||
const { services } = useKibana(); | ||
return ( | ||
<EuiEmptyPrompt | ||
icon={<EuiImage size="fullWidth" src={profilingImg} alt="" />} | ||
title={ | ||
<h2> | ||
{i18n.translate('xpack.observabilityShared.profilingEmptyState.title', { | ||
defaultMessage: | ||
'Improve computational efficiency. Debug performance regressions. Reduce cloud spend.', | ||
})} | ||
</h2> | ||
} | ||
layout="horizontal" | ||
color="plain" | ||
hasBorder | ||
hasShadow={false} | ||
body={ | ||
<> | ||
<p> | ||
{i18n.translate('xpack.observabilityShared.profilingEmptyState.body', { | ||
defaultMessage: | ||
'Elastic Universal Profiling is a whole-system, always-on, continuous profiling solution that eliminates the need for code instrumentation, recompilation, on-host debug symbols, or service restarts. Leveraging eBPF, Universal Profiling operates within the Linux kernel space, capturing only the needed data with minimal overhead in an unobtrusive manner.', | ||
})} | ||
</p> | ||
</> | ||
} | ||
actions={[ | ||
<EuiButton | ||
href={services.http?.basePath.prepend(`/app/profiling`)} | ||
data-test-subj="infraProfilingEmptyStateAddProfilingButton" | ||
color="primary" | ||
fill | ||
> | ||
{i18n.translate('xpack.observabilityShared.profilingEmptyState.addProfiling', { | ||
defaultMessage: 'Add profiling', | ||
})} | ||
</EuiButton>, | ||
<EuiLink | ||
href={`${services.docLinks?.ELASTIC_WEBSITE_URL}/guide/en/observability/${services.docLinks?.DOC_LINK_VERSION}/profiling-get-started.html`} | ||
data-test-subj="infraProfilingEmptyStateGoToDocsButton" | ||
target="_blank" | ||
external | ||
> | ||
{i18n.translate('xpack.observabilityShared.profilingEmptyState.goToDocs', { | ||
defaultMessage: 'Go to docs', | ||
})} | ||
</EuiLink>, | ||
]} | ||
/> | ||
); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters