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

profiling: fix setup page and instructions #150885

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
70 changes: 64 additions & 6 deletions x-pack/plugins/profiling/public/components/check_setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiText } from '@elastic/eui';
import {
EuiButton,
EuiCallOut,
EuiFlexGrid,
EuiFlexGroup,
EuiFlexItem,
EuiLink,
EuiLoadingSpinner,
EuiText,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useState } from 'react';
import { AsyncStatus, useAsync } from '../hooks/use_async';
Expand Down Expand Up @@ -49,6 +58,13 @@ export function CheckSetup({ children }: { children: React.ReactElement }) {
<EuiFlexItem grow={false}>
<EuiLoadingSpinner size="xxl" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText>
{i18n.translate('xpack.profiling.noDataConfig.loading.loaderText', {
defaultMessage: 'Loading data sources',
})}
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
</ProfilingAppPageTemplate>
);
Expand Down Expand Up @@ -81,12 +97,54 @@ export function CheckSetup({ children }: { children: React.ReactElement }) {
action: {
elasticAgent: {
description: (
<EuiText>
{i18n.translate('xpack.profiling.noDataConfig.action.title', {
defaultMessage: `Universal Profiling provides fleet-wide, whole-system, continuous profiling with zero instrumentation.
<EuiFlexGrid gutterSize="s">
<EuiText>
{i18n.translate('xpack.profiling.noDataConfig.action.title', {
defaultMessage: `Universal Profiling provides fleet-wide, whole-system, continuous profiling with zero instrumentation.
Understand what lines of code are consuming compute resources, at all times, and across your entire infrastructure.`,
})}
</EuiText>
})}
</EuiText>
<EuiCallOut
size="s"
color="warning"
title={i18n.translate(
'xpack.profiling.noDataConfig.action.permissionsWarning',
{
defaultMessage:
'To setup Universal Profiling, you must be logged in as a superuser.',
}
)}
/>
<EuiText size={'xs'}>
<ul>
<li>
{i18n.translate('xpack.profiling.noDataConfig.action.dataRetention', {
defaultMessage: `Normal data storage costs apply for profiling data stored in Elasticsearch.
To control data retention. `,
})}
<EuiLink target="_blank" href={docsLink}>
{i18n.translate('xpack.profiling.noDataConfig.readMore.linkLabel', {
defaultMessage: 'Read more',
})}
</EuiLink>
</li>
<li>
{i18n.translate('xpack.profiling.noDataConfig.action.legalBetaTerms', {
defaultMessage: `By using this feature, you acknowledge that you have read and agree to `,
})}
<EuiLink
target="_blank"
href={`https://www.elastic.co/agreements/beta-release-terms`}
>
{i18n.translate('xpack.profiling.noDataConfig.betaTerms.linkLabel', {
defaultMessage: 'Elastic Beta Release Terms',
})}
</EuiLink>
</li>
</ul>
</EuiText>
<EuiText size={'xs'} />
</EuiFlexGrid>
),
onClick: (event: React.MouseEvent<HTMLElement, MouseEvent>) => {
event.preventDefault();
Expand Down
11 changes: 6 additions & 5 deletions x-pack/plugins/profiling/public/components/no_data_page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ docker.elastic.co/observability/profiling-agent:stable /root/pf-host-agent \\
}),
content: (
<EuiCodeBlock paddingSize="s" isCopyable>
wget -O- https://releases.prodfiler.com/stable/pf-host-agent_linux_amd64.tgz | tar xz
wget -O pf-host-agent.tgz &quot;https://ela.st/pf-host-agent-amd64&quot; && tar xzf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why you changed this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, it has been requested without giving a reason. Would be interesting to know. Maybe some OSX or zsh incompatibility ? Do you remember or can you find out ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there's a misunderstanding here 😄
The major change here is the use of a different URL, a redirect.
The redirect URL does not have a file extension, so the downloaded file piped into tar would fail.
Aside from the URL, we mainly changed the wget option to download to a file instead of STDOUT.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you pipe the wget output to tar, you don't need any file extension.
Just try it out yourself:

wget -O- https://ela.st/pf-host-agent-amd64 | tar xz

works like a charm without having to store an intermediate file.

pf-host-agent.tgz
</EuiCodeBlock>
),
},
Expand Down Expand Up @@ -162,8 +163,8 @@ docker.elastic.co/observability/profiling-agent:stable /root/pf-host-agent \\
'Open the URL below and download the right DEB package for your CPU architecture:',
}),
content: (
<EuiLink target="_blank" href={`https://releases.prodfiler.com/stable/index.html`}>
https://releases.prodfiler.com/stable/index.html
<EuiLink target="_blank" href={`https://ela.st/pf-host-agent-linux`}>
https://ela.st/pf-host-agent-linux
</EuiLink>
),
},
Expand Down Expand Up @@ -212,8 +213,8 @@ docker.elastic.co/observability/profiling-agent:stable /root/pf-host-agent \\
'Open the URL below and download the right RPM package for your CPU architecture:',
}),
content: (
<EuiLink target="_blank" href={`https://releases.prodfiler.com/stable/index.html`}>
https://releases.prodfiler.com/stable/index.html
<EuiLink target="_blank" href={`https://ela.st/pf-host-agent-linux`}>
https://ela.st/pf-host-agent-linux
</EuiLink>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function ProfilingHeaderActionMenu() {
<EuiHeaderLink href={router.link('/add-data-instructions')} color="primary">
<EuiFlexGroup direction="row" gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiIcon type="listAdd" />
<EuiIcon type="indexOpen" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
{i18n.translate('xpack.profiling.headerActionMenu.addData', {
Expand Down