-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Display advanced mode toggle for the APM failed transactions table #114363
Changes from 6 commits
431d4a1
bd7c55c
0c920fc
34a4887
258c926
b3c2ae9
8477e29
1c6eb50
612843e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ import { | |
EuiBadge, | ||
EuiToolTip, | ||
RIGHT_ALIGNMENT, | ||
EuiSwitch, | ||
EuiIconTip, | ||
} from '@elastic/eui'; | ||
import type { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; | ||
import type { Direction } from '@elastic/eui/src/services/sort/sort_direction'; | ||
|
@@ -44,7 +46,6 @@ import { useSearchStrategy } from '../../../hooks/use_search_strategy'; | |
|
||
import { ImpactBar } from '../../shared/ImpactBar'; | ||
import { createHref, push } from '../../shared/Links/url_helpers'; | ||
import { Summary } from '../../shared/Summary'; | ||
|
||
import { CorrelationsTable } from './correlations_table'; | ||
import { FailedTransactionsCorrelationsHelpPopover } from './failed_transactions_correlations_help_popover'; | ||
|
@@ -59,6 +60,8 @@ import { CorrelationsLog } from './correlations_log'; | |
import { CorrelationsEmptyStatePrompt } from './empty_state_prompt'; | ||
import { CrossClusterSearchCompatibilityWarning } from './cross_cluster_search_warning'; | ||
import { CorrelationsProgressControls } from './progress_controls'; | ||
import { useLocalStorage } from '../../../hooks/useLocalStorage'; | ||
import { useTheme } from '../../../hooks/use_theme'; | ||
|
||
export function FailedTransactionsCorrelations({ | ||
onFilter, | ||
|
@@ -91,18 +94,49 @@ export function FailedTransactionsCorrelations({ | |
selectedSignificantTerm ?? response.failedTransactionsCorrelations?.[0]; | ||
|
||
const history = useHistory(); | ||
const [showStats, setShowStats] = useLocalStorage( | ||
'apmFailedTransactionsShowAdvancedStats', | ||
false | ||
); | ||
const euiTheme = useTheme(); | ||
|
||
const failedTransactionsCorrelationsColumns: Array< | ||
EuiBasicTableColumn<FailedTransactionsCorrelation> | ||
> = useMemo(() => { | ||
const percentageColumns: Array< | ||
EuiBasicTableColumn<FailedTransactionsCorrelation> | ||
> = inspectEnabled | ||
> = showStats | ||
? [ | ||
{ | ||
width: '100px', | ||
field: 'pValue', | ||
name: 'p-value', | ||
name: ( | ||
<EuiToolTip | ||
content={i18n.translate( | ||
'xpack.apm.correlations.failedTransactions.correlationsTable.pValueDescription', | ||
{ | ||
defaultMessage: | ||
'The chance of getting at least this amount of field name and value for failed transactions given its prevalence in successful transactions.', | ||
} | ||
)} | ||
> | ||
<> | ||
{i18n.translate( | ||
'xpack.apm.correlations.failedTransactions.correlationsTable.pValueLabel', | ||
{ | ||
defaultMessage: 'p-value', | ||
} | ||
)} | ||
<EuiIcon | ||
size="s" | ||
color="subdued" | ||
type="questionInCircle" | ||
className="eui-alignTop" | ||
/> | ||
</> | ||
</EuiToolTip> | ||
), | ||
|
||
render: (pValue: number) => pValue.toPrecision(3), | ||
sortable: true, | ||
}, | ||
|
@@ -182,7 +216,7 @@ export function FailedTransactionsCorrelations({ | |
name: ( | ||
<> | ||
{i18n.translate( | ||
'xpack.apm.correlations.failedTransactions.correlationsTable.pValueLabel', | ||
'xpack.apm.correlations.failedTransactions.correlationsTable.scoreLabel', | ||
{ | ||
defaultMessage: 'Score', | ||
} | ||
|
@@ -315,7 +349,7 @@ export function FailedTransactionsCorrelations({ | |
}, | ||
}, | ||
] as Array<EuiBasicTableColumn<FailedTransactionsCorrelation>>; | ||
}, [history, onFilter, trackApmEvent, inspectEnabled]); | ||
}, [history, onFilter, trackApmEvent, showStats]); | ||
|
||
useEffect(() => { | ||
if (isErrorMessage(progress.error)) { | ||
|
@@ -367,9 +401,6 @@ export function FailedTransactionsCorrelations({ | |
correlationTerms.length < 1 && | ||
(progressNormalized === 1 || !progress.isRunning); | ||
|
||
const showSummaryBadge = | ||
inspectEnabled && (progress.isRunning || correlationTerms.length > 0); | ||
|
||
const transactionDistributionChartData: TransactionDistributionChartData[] = | ||
[]; | ||
|
||
|
@@ -462,17 +493,51 @@ export function FailedTransactionsCorrelations({ | |
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiTitle size="xs"> | ||
<span data-test-subj="apmFailedTransactionsCorrelationsTablePanelTitle"> | ||
{i18n.translate( | ||
'xpack.apm.correlations.failedTransactions.tableTitle', | ||
{ | ||
defaultMessage: 'Correlations', | ||
} | ||
)} | ||
</span> | ||
</EuiTitle> | ||
|
||
<EuiFlexGroup gutterSize="s" alignItems="center"> | ||
<EuiTitle size="xs"> | ||
<span data-test-subj="apmFailedTransactionsCorrelationsTablePanelTitle"> | ||
{i18n.translate( | ||
'xpack.apm.correlations.failedTransactions.tableTitle', | ||
{ | ||
defaultMessage: 'Correlations', | ||
} | ||
)} | ||
</span> | ||
</EuiTitle> | ||
<EuiFlexItem | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
paddingLeft: euiTheme.eui.paddingSizes.s, | ||
}} | ||
> | ||
<EuiSwitch | ||
label={i18n.translate( | ||
'xpack.apm.correlations.latencyCorrelations.advancedStatisticsLabel', | ||
{ | ||
defaultMessage: 'Advanced statistics', | ||
} | ||
)} | ||
checked={showStats} | ||
onChange={(e) => setShowStats(!showStats)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you use a callback here? i.e. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately |
||
compressed={true} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can leave out There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated here 8477e29 |
||
/> | ||
<EuiIconTip | ||
size="m" | ||
iconProps={{ | ||
style: { marginLeft: euiTheme.eui.paddingSizes.xs }, | ||
}} | ||
content={i18n.translate( | ||
'xpack.apm.correlations.latencyCorrelations.advancedStatisticsTooltipContent', | ||
{ | ||
defaultMessage: | ||
'Enable additional statistical information for the correlation results.', | ||
} | ||
)} | ||
type="questionInCircle" | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiSpacer size="s" /> | ||
|
||
<CorrelationsProgressControls | ||
|
@@ -490,20 +555,6 @@ export function FailedTransactionsCorrelations({ | |
</> | ||
)} | ||
|
||
{showSummaryBadge && selectedTerm?.pValue && ( | ||
<> | ||
<EuiSpacer size="m" /> | ||
<Summary | ||
items={[ | ||
<EuiBadge color="hollow"> | ||
{`${selectedTerm.fieldName}: ${selectedTerm.fieldValue}`} | ||
</EuiBadge>, | ||
<>{`p-value: ${selectedTerm.pValue.toPrecision(3)}`}</>, | ||
]} | ||
/> | ||
</> | ||
)} | ||
|
||
<EuiSpacer size="m" /> | ||
|
||
<div data-test-subj="apmCorrelationsTable"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4912,6 +4912,16 @@ | |
"visTypeMetric.colorModes.backgroundOptionLabel": "背景", | ||
"visTypeMetric.colorModes.labelsOptionLabel": "ラベル", | ||
"visTypeMetric.colorModes.noneOptionLabel": "なし", | ||
"visTypeMetric.metricDescription": "計算結果を単独の数字として表示します。", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this is here because some labels were resorted, but it might make sense to undo the changes in these files to prevent merge conflicts (for you or others). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed here 8477e29 |
||
"visTypeMetric.metricTitle": "メトリック", | ||
"visTypeMetric.params.color.useForLabel": "使用する色", | ||
"visTypeMetric.params.rangesTitle": "範囲", | ||
"visTypeMetric.params.settingsTitle": "設定", | ||
"visTypeMetric.params.showTitleLabel": "タイトルを表示", | ||
"visTypeMetric.params.style.fontSizeLabel": "ポイント単位のメトリックフォントサイズ", | ||
"visTypeMetric.params.style.styleTitle": "スタイル", | ||
"visTypeMetric.schemas.metricTitle": "メトリック", | ||
"visTypeMetric.schemas.splitGroupTitle": "グループを分割", | ||
"expressionMetricVis.function.dimension.splitGroup": "グループを分割", | ||
"expressionMetricVis.function.bgFill.help": "html 16 進数コード(#123456)、html 色(red、blue)、または rgba 値(rgba(255,255,255,1))。", | ||
"expressionMetricVis.function.bucket.help": "バケットディメンションの構成です。", | ||
|
@@ -4927,16 +4937,6 @@ | |
"expressionMetricVis.function.showLabels.help": "メトリック値の下にラベルを表示します。", | ||
"expressionMetricVis.function.subText.help": "メトリックの下に表示するカスタムテキスト", | ||
"expressionMetricVis.function.useRanges.help": "有効な色範囲です。", | ||
"visTypeMetric.metricDescription": "計算結果を単独の数字として表示します。", | ||
"visTypeMetric.metricTitle": "メトリック", | ||
"visTypeMetric.params.color.useForLabel": "使用する色", | ||
"visTypeMetric.params.rangesTitle": "範囲", | ||
"visTypeMetric.params.settingsTitle": "設定", | ||
"visTypeMetric.params.showTitleLabel": "タイトルを表示", | ||
"visTypeMetric.params.style.fontSizeLabel": "ポイント単位のメトリックフォントサイズ", | ||
"visTypeMetric.params.style.styleTitle": "スタイル", | ||
"visTypeMetric.schemas.metricTitle": "メトリック", | ||
"visTypeMetric.schemas.splitGroupTitle": "グループを分割", | ||
"visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.deprecation": "Visualizeの円グラフのレガシーグラフライブラリは廃止予定であり、8.0以降ではサポートされません。", | ||
"visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.description": "Visualizeで円グラフのレガシーグラフライブラリを有効にします。", | ||
"visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.name": "円グラフのレガシーグラフライブラリ", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qn895 @formgeist is there any value in hiding the switch when no correlations are found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peteharverson I think the result would be that the switch would come and go which can be confusing too