-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Fix APM latency order of sticky header properties, add help popo…
…ver (#103759) * [ML] APM latency correlations help popover * Remove spacer * [ML] Updates correlation tooltip * Remove scss, use styled popover instead * Fix order to be Service > Environment > Transaction * Addresses popover text feedback * Addresses more popover text feedback * Adds performance warning to popover; improves tooltip * Internationalizes aria label in popover * Internationalizes aria label in ML popover Co-authored-by: Quynh Nguyen <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
fd4b9df
commit bd2e4e3
Showing
6 changed files
with
165 additions
and
25 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
64 changes: 64 additions & 0 deletions
64
...k/plugins/apm/public/components/app/correlations/ml_latency_correlations_help_popover.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,64 @@ | ||
/* | ||
* 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, { useState } from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { HelpPopover, HelpPopoverButton } from '../help_popover/help_popover'; | ||
|
||
export function LatencyCorrelationsHelpPopover() { | ||
const [isPopoverOpen, setIsPopoverOpen] = useState(false); | ||
|
||
return ( | ||
<HelpPopover | ||
anchorPosition="leftUp" | ||
button={ | ||
<HelpPopoverButton | ||
onClick={() => { | ||
setIsPopoverOpen(!isPopoverOpen); | ||
}} | ||
/> | ||
} | ||
closePopover={() => setIsPopoverOpen(false)} | ||
isOpen={isPopoverOpen} | ||
title={i18n.translate('xpack.apm.correlations.latencyPopoverTitle', { | ||
defaultMessage: 'Latency correlations', | ||
})} | ||
> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.apm.correlations.latencyPopoverBasicExplanation" | ||
defaultMessage="Correlations help you discover which attributes are contributing to increased transaction response times or latency." | ||
/> | ||
</p> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.apm.correlations.latencyPopoverChartExplanation" | ||
defaultMessage="The latency distribution chart visualizes the overall latency of the transactions in the service. When you hover over attributes in the table, their latency distribution is added to the chart." | ||
/> | ||
</p> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.apm.correlations.latencyPopoverTableExplanation" | ||
defaultMessage="The table is sorted by correlation coefficients that range from 0 to 1. Attributes with higher correlation values are more likely to contribute to high latency transactions." | ||
/> | ||
</p> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.apm.correlations.latencyPopoverPerformanceExplanation" | ||
defaultMessage="This analysis performs statistical searches across a large number of attributes. For large time ranges and services with high transaction throughput, this might take some time. Reduce the time range to improve performance." | ||
/> | ||
</p> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.apm.correlations.latencyPopoverFilterExplanation" | ||
defaultMessage="You can also add or remove filters to affect the queries in the APM app." | ||
/> | ||
</p> | ||
</HelpPopover> | ||
); | ||
} |
72 changes: 72 additions & 0 deletions
72
x-pack/plugins/apm/public/components/app/help_popover/help_popover.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,72 @@ | ||
/* | ||
* 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, { ReactNode } from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { | ||
EuiButtonIcon, | ||
EuiLinkButtonProps, | ||
EuiPopover, | ||
EuiPopoverProps, | ||
EuiPopoverTitle, | ||
EuiText, | ||
} from '@elastic/eui'; | ||
import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; | ||
|
||
const PopoverContent = euiStyled(EuiText)` | ||
max-width: 480px; | ||
max-height: 40vh; | ||
`; | ||
|
||
export function HelpPopoverButton({ | ||
onClick, | ||
}: { | ||
onClick: EuiLinkButtonProps['onClick']; | ||
}) { | ||
return ( | ||
<EuiButtonIcon | ||
className="apmHelpPopover__buttonIcon" | ||
size="s" | ||
iconType="help" | ||
aria-label={i18n.translate('xpack.apm.helpPopover.ariaLabel', { | ||
defaultMessage: 'Help', | ||
})} | ||
onClick={onClick} | ||
/> | ||
); | ||
} | ||
|
||
export function HelpPopover({ | ||
anchorPosition, | ||
button, | ||
children, | ||
closePopover, | ||
isOpen, | ||
title, | ||
}: { | ||
anchorPosition?: EuiPopoverProps['anchorPosition']; | ||
button: EuiPopoverProps['button']; | ||
children: ReactNode; | ||
closePopover: EuiPopoverProps['closePopover']; | ||
isOpen: EuiPopoverProps['isOpen']; | ||
title?: string; | ||
}) { | ||
return ( | ||
<EuiPopover | ||
anchorPosition={anchorPosition} | ||
button={button} | ||
closePopover={closePopover} | ||
isOpen={isOpen} | ||
panelPaddingSize="s" | ||
ownFocus | ||
> | ||
{title && <EuiPopoverTitle paddingSize="s">{title}</EuiPopoverTitle>} | ||
|
||
<PopoverContent size="s">{children}</PopoverContent> | ||
</EuiPopover> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/apm/public/components/app/help_popover/index.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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { HelpPopoverButton, HelpPopover } from './help_popover'; |
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