[Infra UI] Add tooltips to Asset Details (#164858)

Closes https://github.com/elastic/kibana/issues/164594
## Summary

This PR adds tooltips to explain the time range used to collect process
data and metadata. The tooltips will be shown inside the overview
(metadata summary section) tab, metadata tab, and processes tab (both
flyout and full page views).

## Fixes

I saw that the icons showing different explanation/ docs links inside
the overveiew tab are not consistent ( sometimes we have
`questionInCircle` and sometimes `iInCircles`) - the designs are using
`iInCircles` so I changed it everywhere:
<img width="671" alt="icons"
src="edda271b-5030-4d83-9722-448fbae8cf8b">


## Testing
1. Go to host view and open the flyout for any host. The new explanation
and tooltips should be shown in:
   - Overview tab
   
<img width="938" alt="overview"
src="ac4ae369-d825-4fba-8865-c9410de29c28">

   - Metadata tab
   
<img width="945" alt="metadata"
src="4d174bf3-3411-40a5-a208-eb5df2266c61">

   - Processed tab
   
<img width="937" alt="processes"
src="11d32c66-4a25-4fce-a95e-42698f2e1682">
2. Click Open as page and check the same on the asset details page 


<img width="1653" alt="Screenshot 2023-08-28 at 11 28 47"
src="342d1565-bb51-4961-b8ac-8b8270c851ff">
<img width="1637" alt="Screenshot 2023-08-28 at 11 28 32"
src="63b66a12-d634-4ecc-83de-ad1e1b79334c">
<img width="1649" alt="Screenshot 2023-08-28 at 11 28 16"
src="59720bf3-88ad-44b1-8584-769b38d956ed">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
jennypavlova 2023-08-30 20:26:42 +02:00 committed by GitHub
parent cf16ebd3a0
commit a511426e83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 439 additions and 164 deletions

View file

@ -83,6 +83,14 @@ export const InfraMetadataInfoRT = rt.partial({
cloud: InfraMetadataCloudRT,
host: InfraMetadataHostRT,
agent: InfraMetadataAgentRT,
'@timestamp': rt.string,
});
export const InfraMetadataInfoResponseRT = rt.partial({
cloud: InfraMetadataCloudRT,
host: InfraMetadataHostRT,
agent: InfraMetadataAgentRT,
timestamp: rt.string,
});
const InfraMetadataRequiredRT = rt.type({
@ -92,7 +100,7 @@ const InfraMetadataRequiredRT = rt.type({
});
const InfraMetadataOptionalRT = rt.partial({
info: InfraMetadataInfoRT,
info: InfraMetadataInfoResponseRT,
});
export const InfraMetadataRT = rt.intersection([InfraMetadataRequiredRT, InfraMetadataOptionalRT]);

View file

@ -0,0 +1,102 @@
/*
* 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 React from 'react';
import { EuiText, EuiLink } from '@elastic/eui';
import { FormattedDate, FormattedMessage, FormattedTime } from '@kbn/i18n-react';
import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui';
import { Popover } from '../tabs/common/popover';
import { useMetadataStateProviderContext } from '../hooks/use_metadata_state';
const HOSTNAME_DOCS_LINK =
'https://www.elastic.co/guide/en/ecs/current/ecs-host.html#field-host-name';
const MetadataExplanationTooltipContent = React.memo(() => {
const onClick = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
e.stopPropagation();
};
return (
<EuiText size="s" onClick={onClick} style={{ width: 200 }}>
<FormattedMessage
id="xpack.infra.assetDetails.metadata.tooltip.documentationLabel"
defaultMessage="{metadata} is populated from the last event detected for this {hostName} for the selected date period."
values={{
metadata: (
<i>
<FormattedMessage
id="xpack.infra.assetDetails.metadata.tooltip.metadata"
defaultMessage="Metadata"
/>
</i>
),
hostName: (
<EuiLink
data-test-subj="infraAssetDetailsTooltipDocumentationLink"
href={HOSTNAME_DOCS_LINK}
target="_blank"
>
<FormattedMessage
id="xpack.infra.assetDetails.metadata.tooltip.documentationLink"
defaultMessage="host.name"
/>
</EuiLink>
),
}}
/>
</EuiText>
);
});
export const MetadataExplanationMessage = () => {
const { metadata, loading } = useMetadataStateProviderContext();
return loading ? (
<EuiLoadingSpinner />
) : metadata?.info?.timestamp ? (
<EuiFlexGroup gutterSize="xs" alignItems="baseline">
<EuiFlexItem grow={false}>
<EuiText size="xs" color="subdued">
<FormattedMessage
id="xpack.infra.assetDetails.metadata.tooltip.metadataSectionTitle"
defaultMessage="Showing metadata collected on {date} @ {time}"
values={{
date: (
<FormattedDate
value={new Date(metadata?.info?.timestamp)}
month="short"
day="numeric"
year="numeric"
/>
),
time: (
<FormattedTime
value={new Date(metadata?.info?.timestamp)}
hour12={false}
hour="2-digit"
minute="2-digit"
second="2-digit"
/>
),
}}
/>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<Popover
iconSize="s"
iconColor="subdued"
icon="iInCircle"
panelPaddingSize="m"
data-test-subj="infraAssetDetailsMetadataPopoverButton"
>
<MetadataExplanationTooltipContent />
</Popover>
</EuiFlexItem>
</EuiFlexGroup>
) : null;
};

View file

@ -0,0 +1,111 @@
/*
* 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 React from 'react';
import { EuiText, EuiLink } from '@elastic/eui';
import { FormattedDate, FormattedMessage, FormattedTime } from '@kbn/i18n-react';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { useDateRangeProviderContext } from '../hooks/use_date_range';
import { Popover } from '../tabs/common/popover';
const DOCUMENTATION_LINK =
'https://www.elastic.co/guide/en/observability/current/view-infrastructure-metrics.html';
const SYSTEM_INTEGRATION_DOCS_LINK = 'https://docs.elastic.co/en/integrations/system';
const ProcessesExplanationTooltipContent = React.memo(() => {
const onClick = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
e.stopPropagation();
};
return (
<EuiText size="s" onClick={onClick} style={{ width: 300 }}>
<p>
<FormattedMessage
id="xpack.infra.assetDetails.processes.tooltip.explanationLabel"
defaultMessage="The processes listed are based on an aggregation of the top CPU and the top memory consuming processes for the 1 minute preceding the end date of the selected time period. The number of top processes is configurable in the {systemIntegration}."
values={{
systemIntegration: (
<EuiLink
data-test-subj="infraAssetDetailsTooltipSystemIntegrationDocumentationLink"
href={SYSTEM_INTEGRATION_DOCS_LINK}
target="_blank"
>
<FormattedMessage
id="xpack.infra.assetDetails.processes.tooltip.systemIntegrationDocumentationLink"
defaultMessage="System Integration"
/>
</EuiLink>
),
}}
/>
</p>
<p>
<FormattedMessage
id="xpack.infra.assetDetails.processes.tooltip.documentationLabel"
defaultMessage="Please see the following {documentation} for more details on processes."
values={{
documentation: (
<EuiLink
data-test-subj="infraAssetDetailsTooltipDocumentationLink"
href={DOCUMENTATION_LINK}
target="_blank"
>
<FormattedMessage
id="xpack.infra.assetDetails.processes.tooltip.documentationLink"
defaultMessage="documentation"
/>
</EuiLink>
),
}}
/>
</p>
</EuiText>
);
});
export const ProcessesExplanationMessage = () => {
const { getDateRangeInTimestamp } = useDateRangeProviderContext();
const dateFromRange = new Date(getDateRangeInTimestamp().to);
return (
<EuiFlexGroup gutterSize="xs" alignItems="baseline">
<EuiFlexItem grow={false}>
<EuiText size="xs" color="subdued">
<FormattedMessage
id="xpack.infra.assetDetails.overview.processesSectionTitle"
defaultMessage="Showing process data collected for the 1 minute preceding {date} @ {time}"
values={{
date: (
<FormattedDate value={dateFromRange} month="short" day="numeric" year="numeric" />
),
time: (
<FormattedTime
value={dateFromRange}
hour12={false}
hour="2-digit"
minute="2-digit"
second="2-digit"
/>
),
}}
/>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<Popover
iconSize="s"
iconColor="subdued"
icon="iInCircle"
panelPaddingSize="m"
data-test-subj="infraAssetDetailsProcessesPopoverButton"
>
<ProcessesExplanationTooltipContent />
</Popover>
</EuiFlexItem>
</EuiFlexGroup>
);
};

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { EuiPopover, EuiIcon, IconType } from '@elastic/eui';
import { PanelPaddingSize } from '@elastic/eui';
import { EuiPopover, EuiIcon, type IconType, type IconColor, type IconSize } from '@elastic/eui';
import { css } from '@emotion/react';
import React from 'react';
import { useBoolean } from '../../../../hooks/use_boolean';
@ -13,20 +14,28 @@ import { useBoolean } from '../../../../hooks/use_boolean';
export const Popover = ({
children,
icon,
iconColor,
iconSize,
panelPaddingSize,
...props
}: {
children: React.ReactNode;
icon: IconType;
iconColor?: IconColor;
iconSize?: IconSize;
panelPaddingSize?: PanelPaddingSize;
'data-test-subj'?: string;
}) => {
const [isPopoverOpen, { off: closePopover, toggle: togglePopover }] = useBoolean(false);
return (
<EuiPopover
panelPaddingSize="s"
panelPaddingSize={panelPaddingSize ?? 's'}
button={
<EuiIcon
data-test-subj={props['data-test-subj']}
type={icon}
color={iconColor ?? 'text'}
size={iconSize ?? 'original'}
onClick={togglePopover}
css={css`
cursor: pointer;

View file

@ -7,11 +7,12 @@
import React, { useCallback, useMemo } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiCallOut, EuiLink } from '@elastic/eui';
import { EuiCallOut, EuiLink, EuiHorizontalRule } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { Table } from './table';
import { getAllFields } from './utils';
import { useMetadataStateProviderContext } from '../../hooks/use_metadata_state';
import { MetadataExplanationMessage } from '../../components/metadata_explanation';
import { useAssetDetailsRenderPropsContext } from '../../hooks/use_asset_details_render_props';
import { useAssetDetailsUrlState } from '../../hooks/use_asset_details_url_state';
@ -70,13 +71,17 @@ export const Metadata = () => {
}
return (
<Table
search={urlState?.metadataSearch}
onSearchChange={onSearchChange}
showActionsColumn={showActionsColumn}
rows={fields}
loading={metadataLoading}
/>
<>
<MetadataExplanationMessage />
<EuiHorizontalRule margin="m" />
<Table
search={urlState?.metadataSearch}
onSearchChange={onSearchChange}
showActionsColumn={showActionsColumn}
rows={fields}
loading={metadataLoading}
/>
</>
);
};

View file

@ -56,10 +56,7 @@ export const MetadataHeader = ({ metadataValue }: MetadataSummaryProps) => {
{columnTitles[metadataValue.field as MetadataFields]}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<Popover
icon="questionInCircle"
data-test-subj="infraAssetDetailsMetadataSummaryPopoverButton"
>
<Popover icon="iInCircle" data-test-subj="infraAssetDetailsMetadataSummaryPopoverButton">
<EuiText size="xs">
{metadataValue.tooltipLink ? (
<FormattedMessage

View file

@ -14,13 +14,16 @@ import {
EuiDescriptionList,
EuiDescriptionListDescription,
EuiLoadingSpinner,
EuiSpacer,
} from '@elastic/eui';
import { EuiTitle } from '@elastic/eui';
import type { InfraMetadata } from '../../../../../../common/http_api';
import { NOT_AVAILABLE_LABEL } from '../../../translations';
import { useTabSwitcherContext } from '../../../hooks/use_tab_switcher';
import { FlyoutTabIds } from '../../../types';
import { ExpandableContent } from '../../../components/expandable_content';
import { MetadataHeader } from './metadata_header';
import { MetadataExplanationMessage } from '../../../components/metadata_explanation';
interface MetadataSummaryProps {
metadata: InfraMetadata | null;
@ -75,7 +78,36 @@ export const MetadataSummaryList = ({
};
return (
<EuiFlexGroup gutterSize="m" responsive={false} wrap justifyContent="spaceBetween">
<>
<EuiFlexGroup gutterSize="m" responsive={false} wrap justifyContent="spaceBetween">
<EuiFlexGroup alignItems="flexStart">
<EuiTitle data-test-subj="infraAssetDetailsMetadataTitle" size="xxs">
<span>
<FormattedMessage
id="xpack.infra.assetDetails.overview.metadataSectionTitle"
defaultMessage="Metadata"
/>
</span>
</EuiTitle>
</EuiFlexGroup>
<EuiFlexItem grow={false} key="metadata-link">
<EuiButtonEmpty
data-test-subj="infraAssetDetailsMetadataShowAllButton"
onClick={onClick}
size="xs"
flush="both"
iconSide="right"
iconType="sortRight"
>
<FormattedMessage
id="xpack.infra.assetDetailsEmbeddable.metadataSummary.showAllMetadataButton"
defaultMessage="Show all"
/>
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
<MetadataExplanationMessage />
<EuiSpacer size="s" />
<EuiFlexGroup alignItems="flexStart">
{(isCompactView
? metadataData(metadata?.info)
@ -98,21 +130,6 @@ export const MetadataSummaryList = ({
)
)}
</EuiFlexGroup>
<EuiFlexItem grow={false} key="metadata-link">
<EuiButtonEmpty
data-test-subj="infraAssetDetailsMetadataShowAllButton"
onClick={onClick}
size="xs"
flush="both"
iconSide="right"
iconType="sortRight"
>
<FormattedMessage
id="xpack.infra.assetDetailsEmbeddable.metadataSummary.showAllMetadataButton"
defaultMessage="Show all"
/>
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</>
);
};

View file

@ -121,7 +121,7 @@ const MetricsSectionTitle = () => {
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<Popover icon="questionInCircle" data-test-subj="infraAssetDetailsMetricsPopoverButton">
<Popover icon="iInCircle" data-test-subj="infraAssetDetailsMetricsPopoverButton">
<HostMetricsExplanationContent />
</Popover>
</EuiFlexItem>

View file

@ -19,6 +19,7 @@ import {
EuiFlexItem,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiLoadingSpinner } from '@elastic/eui';
import { parseSearchString } from './parse_search_string';
import { ProcessesTable } from './processes_table';
import { STATE_NAMES } from './states';
@ -31,6 +32,7 @@ import {
import { getFieldByType } from '../../../../../common/inventory_models';
import { useAssetDetailsRenderPropsContext } from '../../hooks/use_asset_details_render_props';
import { useDateRangeProviderContext } from '../../hooks/use_date_range';
import { ProcessesExplanationMessage } from '../../components/processes_explanation';
import { useAssetDetailsUrlState } from '../../hooks/use_asset_details_url_state';
const options = Object.entries(STATE_NAMES).map(([value, view]: [string, string]) => ({
@ -130,6 +132,11 @@ export const Processes = () => {
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
{loading ? (
<EuiLoadingSpinner />
) : (
!error && (response?.processList ?? []).length > 0 && <ProcessesExplanationMessage />
)}
<EuiFlexItem grow={false}>
<EuiSearchBar
query={searchBarState}

View file

@ -83,7 +83,10 @@ export const initMetadataRoute = (libs: InfraBackendLibs) => {
id,
name,
features: [...metricFeatures, ...cloudMetricsFeatures],
info,
info: {
...info,
timestamp: info['@timestamp'],
},
}),
});
}

View file

@ -59,7 +59,7 @@ export const getNodeInfo = async (
index: sourceConfiguration.metricAlias,
body: {
size: 1,
_source: ['host.*', 'cloud.*', 'agent.*'],
_source: ['host.*', 'cloud.*', 'agent.*', TIMESTAMP_FIELD],
sort: [{ [TIMESTAMP_FIELD]: 'desc' }],
query: {
bool: {

View file

@ -99,38 +99,42 @@ export default function ({ getService }: FtrProviderContext) {
if (metadata) {
expect(metadata.features.length).to.be(58);
expect(metadata.name).to.equal('gke-observability-8--observability-8--bc1afd95-f0zc');
expect(metadata.info).to.eql({
cloud: {
availability_zone: 'europe-west1-c',
instance: {
name: 'gke-observability-8--observability-8--bc1afd95-f0zc',
id: '6200309808276807579',
},
provider: 'gcp',
machine: { type: 'n1-standard-4' },
project: { id: 'elastic-observability' },
},
agent: {
hostname: 'gke-observability-8--observability-8--bc1afd95-f0zc',
id: 'c91c0d2b-6483-46bb-9731-f06afd32bb59',
ephemeral_id: '7cb259b1-795c-4c76-beaf-2eb8f18f5b02',
type: 'metricbeat',
version: '8.0.0',
},
host: {
hostname: 'gke-observability-8--observability-8--bc1afd95-f0zc',
os: {
kernel: '4.14.127+',
codename: 'Core',
name: 'CentOS Linux',
family: 'redhat',
version: '7 (Core)',
platform: 'centos',
},
containerized: false,
expect(new Date(metadata.info?.timestamp ?? '')?.getTime()).to.be.above(
timeRange800withAws.from
);
expect(new Date(metadata.info?.timestamp ?? '')?.getTime()).to.be.below(
timeRange800withAws.to
);
expect(metadata.info?.cloud).to.eql({
availability_zone: 'europe-west1-c',
instance: {
name: 'gke-observability-8--observability-8--bc1afd95-f0zc',
architecture: 'x86_64',
id: '6200309808276807579',
},
provider: 'gcp',
machine: { type: 'n1-standard-4' },
project: { id: 'elastic-observability' },
});
expect(metadata.info?.agent).to.eql({
hostname: 'gke-observability-8--observability-8--bc1afd95-f0zc',
id: 'c91c0d2b-6483-46bb-9731-f06afd32bb59',
ephemeral_id: '7cb259b1-795c-4c76-beaf-2eb8f18f5b02',
type: 'metricbeat',
version: '8.0.0',
});
expect(metadata.info?.host).to.eql({
hostname: 'gke-observability-8--observability-8--bc1afd95-f0zc',
os: {
kernel: '4.14.127+',
codename: 'Core',
name: 'CentOS Linux',
family: 'redhat',
version: '7 (Core)',
platform: 'centos',
},
containerized: false,
name: 'gke-observability-8--observability-8--bc1afd95-f0zc',
architecture: 'x86_64',
});
} else {
throw new Error('Metadata should never be empty');
@ -148,38 +152,42 @@ export default function ({ getService }: FtrProviderContext) {
expect(metadata.features.length).to.be(19);
expect(metadata.features.some((f) => f.name === 'aws.ec2')).to.be(true);
expect(metadata.name).to.equal('ip-172-31-47-9.us-east-2.compute.internal');
expect(metadata.info).to.eql({
cloud: {
availability_zone: 'us-east-2c',
image: { id: 'ami-0d8f6eb4f641ef691' },
instance: { id: 'i-011454f72559c510b' },
provider: 'aws',
machine: { type: 't2.micro' },
region: 'us-east-2',
account: { id: '015351775590' },
},
agent: {
hostname: 'ip-172-31-47-9.us-east-2.compute.internal',
id: 'd0943b36-d0d3-426d-892b-7d79c071b44b',
ephemeral_id: '64c94244-88b8-4a37-adc0-30428fefaf53',
type: 'metricbeat',
version: '8.0.0',
},
host: {
hostname: 'ip-172-31-47-9.us-east-2.compute.internal',
os: {
kernel: '4.14.123-111.109.amzn2.x86_64',
codename: 'Karoo',
name: 'Amazon Linux',
family: 'redhat',
version: '2',
platform: 'amzn',
},
containerized: false,
name: 'ip-172-31-47-9.us-east-2.compute.internal',
id: 'ded64cbff86f478990a3dfbb63a8d238',
architecture: 'x86_64',
expect(new Date(metadata.info?.timestamp ?? '')?.getTime()).to.be.above(
timeRange800withAws.from
);
expect(new Date(metadata.info?.timestamp ?? '')?.getTime()).to.be.below(
timeRange800withAws.to
);
expect(metadata.info?.cloud).to.eql({
availability_zone: 'us-east-2c',
image: { id: 'ami-0d8f6eb4f641ef691' },
instance: { id: 'i-011454f72559c510b' },
provider: 'aws',
machine: { type: 't2.micro' },
region: 'us-east-2',
account: { id: '015351775590' },
});
expect(metadata.info?.agent).to.eql({
hostname: 'ip-172-31-47-9.us-east-2.compute.internal',
id: 'd0943b36-d0d3-426d-892b-7d79c071b44b',
ephemeral_id: '64c94244-88b8-4a37-adc0-30428fefaf53',
type: 'metricbeat',
version: '8.0.0',
});
expect(metadata.info?.host).to.eql({
hostname: 'ip-172-31-47-9.us-east-2.compute.internal',
os: {
kernel: '4.14.123-111.109.amzn2.x86_64',
codename: 'Karoo',
name: 'Amazon Linux',
family: 'redhat',
version: '2',
platform: 'amzn',
},
containerized: false,
name: 'ip-172-31-47-9.us-east-2.compute.internal',
id: 'ded64cbff86f478990a3dfbb63a8d238',
architecture: 'x86_64',
});
} else {
throw new Error('Metadata should never be empty');
@ -197,42 +205,46 @@ export default function ({ getService }: FtrProviderContext) {
expect(metadata.features.length).to.be(29);
// With this data set the `kubernetes.pod.name` fields have been removed.
expect(metadata.name).to.equal('fluentd-gcp-v3.2.0-np7vw');
expect(metadata.info).to.eql({
cloud: {
instance: {
id: '6613144177892233360',
name: 'gke-observability-8--observability-8--bc1afd95-ngmh',
},
provider: 'gcp',
availability_zone: 'europe-west1-c',
machine: {
type: 'n1-standard-4',
},
project: {
id: 'elastic-observability',
},
},
agent: {
hostname: 'gke-observability-8--observability-8--bc1afd95-ngmh',
id: '66dc19e6-da36-49d2-9471-2c9475503178',
ephemeral_id: 'a0c3a9ff-470a-41a0-bf43-d1af6b7a3b5b',
type: 'metricbeat',
version: '8.0.0',
},
host: {
hostname: 'gke-observability-8--observability-8--bc1afd95-ngmh',
expect(new Date(metadata.info?.timestamp ?? '')?.getTime()).to.be.above(
timeRange800withAws.from
);
expect(new Date(metadata.info?.timestamp ?? '')?.getTime()).to.be.below(
timeRange800withAws.to
);
expect(metadata.info?.cloud).to.eql({
instance: {
id: '6613144177892233360',
name: 'gke-observability-8--observability-8--bc1afd95-ngmh',
os: {
codename: 'Core',
family: 'redhat',
kernel: '4.14.127+',
name: 'CentOS Linux',
platform: 'centos',
version: '7 (Core)',
},
architecture: 'x86_64',
containerized: false,
},
provider: 'gcp',
availability_zone: 'europe-west1-c',
machine: {
type: 'n1-standard-4',
},
project: {
id: 'elastic-observability',
},
});
expect(metadata.info?.agent).to.eql({
hostname: 'gke-observability-8--observability-8--bc1afd95-ngmh',
id: '66dc19e6-da36-49d2-9471-2c9475503178',
ephemeral_id: 'a0c3a9ff-470a-41a0-bf43-d1af6b7a3b5b',
type: 'metricbeat',
version: '8.0.0',
});
expect(metadata.info?.host).to.eql({
hostname: 'gke-observability-8--observability-8--bc1afd95-ngmh',
name: 'gke-observability-8--observability-8--bc1afd95-ngmh',
os: {
codename: 'Core',
family: 'redhat',
kernel: '4.14.127+',
name: 'CentOS Linux',
platform: 'centos',
version: '7 (Core)',
},
architecture: 'x86_64',
containerized: false,
});
} else {
throw new Error('Metadata should never be empty');
@ -248,45 +260,49 @@ export default function ({ getService }: FtrProviderContext) {
});
if (metadata) {
expect(metadata.features.length).to.be(26);
expect(new Date(metadata.info?.timestamp ?? '')?.getTime()).to.be.above(
timeRange800withAws.from
);
expect(new Date(metadata.info?.timestamp ?? '')?.getTime()).to.be.below(
timeRange800withAws.to
);
expect(metadata.name).to.equal(
'k8s_prometheus-to-sd-exporter_fluentd-gcp-v3.2.0-w68r5_kube-system_26950cde-9aed-11e9-9a96-42010a84004d_0'
);
expect(metadata.info).to.eql({
cloud: {
instance: {
id: '4039094952262994102',
name: 'gke-observability-8--observability-8--bc1afd95-nhhw',
},
provider: 'gcp',
availability_zone: 'europe-west1-c',
machine: {
type: 'n1-standard-4',
},
project: {
id: 'elastic-observability',
},
},
agent: {
hostname: 'gke-observability-8--observability-8--bc1afd95-nhhw',
id: 'c58a514c-e971-4590-8206-385400e184dd',
ephemeral_id: 'e9d46cb0-2e89-469d-bd3b-6f32d7c96cc0',
type: 'metricbeat',
version: '8.0.0',
},
host: {
hostname: 'gke-observability-8--observability-8--bc1afd95-nhhw',
expect(metadata.info?.cloud).to.eql({
instance: {
id: '4039094952262994102',
name: 'gke-observability-8--observability-8--bc1afd95-nhhw',
os: {
codename: 'Core',
family: 'redhat',
kernel: '4.14.127+',
name: 'CentOS Linux',
platform: 'centos',
version: '7 (Core)',
},
architecture: 'x86_64',
containerized: false,
},
provider: 'gcp',
availability_zone: 'europe-west1-c',
machine: {
type: 'n1-standard-4',
},
project: {
id: 'elastic-observability',
},
});
expect(metadata.info?.agent).to.eql({
hostname: 'gke-observability-8--observability-8--bc1afd95-nhhw',
id: 'c58a514c-e971-4590-8206-385400e184dd',
ephemeral_id: 'e9d46cb0-2e89-469d-bd3b-6f32d7c96cc0',
type: 'metricbeat',
version: '8.0.0',
});
expect(metadata.info?.host).to.eql({
hostname: 'gke-observability-8--observability-8--bc1afd95-nhhw',
name: 'gke-observability-8--observability-8--bc1afd95-nhhw',
os: {
codename: 'Core',
family: 'redhat',
kernel: '4.14.127+',
name: 'CentOS Linux',
platform: 'centos',
version: '7 (Core)',
},
architecture: 'x86_64',
containerized: false,
});
} else {
throw new Error('Metadata should never be empty');