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

[APM] Correlations Beta (#86477) #89952

Merged
merged 23 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d321f85
[APM] Correlations GA (#86477)
ogupte Feb 2, 2021
9110ffa
polish and improvements to correlations UI
ogupte Feb 4, 2021
63da7e6
more improvements and polish
ogupte Feb 5, 2021
d93f4ca
added impact bar
ogupte Feb 9, 2021
711bfe6
added descriptions
ogupte Feb 9, 2021
38d6a61
make custom field persistence be unique per service
ogupte Feb 9, 2021
c535b4a
make custom threshold unique per service in latency correlations
ogupte Feb 9, 2021
3fece27
adds telemetry for apm correlations feature. Events:
ogupte Feb 9, 2021
c52deb3
adds more telemetry for correlations (#90622)
ogupte Feb 9, 2021
906cb6d
removes the raw score column
ogupte Feb 11, 2021
185bfe6
replaces experiemental callout with beta badge
ogupte Feb 11, 2021
1c99c5c
replaces threshold number input with percentile option selector
ogupte Feb 11, 2021
6a0b5e0
improvements to latency correlations scoring and percentage reporting
ogupte Feb 12, 2021
f878301
Merge branch 'master' into apm-86477-correlations-ga
ogupte Feb 12, 2021
54ff95d
Merge branch 'master' into apm-86477-correlations-ga
ogupte Feb 16, 2021
30b188c
removes the 'apm:enableCorrelations' UI setting
ogupte Feb 16, 2021
429bc7b
- rename useFieldNames.ts -> use_field_names.ts
ogupte Feb 16, 2021
cab10a2
Fixes casing issue for the 'correlations' dir
ogupte Feb 16, 2021
0f09c0b
[APM] Moves correlations button to service details tabslist row (#91080)
ogupte Feb 16, 2021
b5f69ab
[APM] Adds license check for correlations (#90766)
ogupte Feb 16, 2021
cd3407e
[APM] Adds metrics tracking for correlations views and license prompt…
ogupte Feb 16, 2021
7eae6b9
Updated the API integration tests to check for new default fields and…
ogupte Feb 16, 2021
50cd63a
Merge branch 'master' into apm-86477-correlations-ga
kibanamachine Feb 17, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,4 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
'securitySolution:rulesTableRefresh': { type: 'text' },
'apm:enableSignificantTerms': { type: 'boolean' },
'apm:enableServiceOverview': { type: 'boolean' },
'apm:enableCorrelations': { type: 'boolean' },
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export interface UsageStats {
'securitySolution:rulesTableRefresh': string;
'apm:enableSignificantTerms': boolean;
'apm:enableServiceOverview': boolean;
'apm:enableCorrelations': boolean;
'visualize:enableLabs': boolean;
'visualization:heatmap:maxBuckets': number;
'visualization:colorMapping': string;
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4384,9 +4384,6 @@
},
"apm:enableServiceOverview": {
"type": "boolean"
},
"apm:enableCorrelations": {
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, You'd need to open a corresponding mapping update request in the infra repo to have this key removed from the telemetry mappings.
If you don't care that it's not there in versions from 7.12, then you won't need to open an issue for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll probably remove it from the mapping in the infra repo in 7.13. That way we'll be able to tell if users are still using it as a custom UI Setting for version 7.12.

"type": "boolean"
}
}
},
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/apm/common/ui_settings_keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
* 2.0.
*/

export const enableCorrelations = 'apm:enableCorrelations';
export const enableServiceOverview = 'apm:enableServiceOverview';
108 changes: 0 additions & 108 deletions x-pack/plugins/apm/public/components/app/Correlations/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@
* 2.0.
*/

import React from 'react';
import { EuiIcon, EuiLink } from '@elastic/eui';
import React, { useCallback } from 'react';
import { debounce } from 'lodash';
import {
EuiIcon,
EuiLink,
EuiBasicTable,
EuiBasicTableColumn,
EuiToolTip,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useHistory } from 'react-router-dom';
import { EuiBasicTable } from '@elastic/eui';
import { EuiBasicTableColumn } from '@elastic/eui';
import { EuiCode } from '@elastic/eui';
import { asInteger, asPercent } from '../../../../common/utils/formatters';
import { APIReturnType } from '../../../services/rest/createCallApmApi';
import { FETCH_STATUS } from '../../../hooks/use_fetcher';
import { createHref, push } from '../../shared/Links/url_helpers';
import { ImpactBar } from '../../shared/ImpactBar';
import { useUiTracker } from '../../../../../observability/public';

type CorrelationsApiResponse =
| APIReturnType<'GET /api/apm/correlations/failed_transactions'>
Expand All @@ -27,49 +34,83 @@ type SignificantTerm = NonNullable<
interface Props<T> {
significantTerms?: T[];
status: FETCH_STATUS;
cardinalityColumnName: string;
percentageColumnName: string;
setSelectedSignificantTerm: (term: T | null) => void;
onFilter: () => void;
}

export function SignificantTermsTable<T extends SignificantTerm>({
export function CorrelationsTable<T extends SignificantTerm>({
significantTerms,
status,
cardinalityColumnName,
percentageColumnName,
setSelectedSignificantTerm,
onFilter,
}: Props<T>) {
const trackApmEvent = useUiTracker({ app: 'apm' });
const trackSelectSignificantTerm = useCallback(
() =>
debounce(
() => trackApmEvent({ metric: 'select_significant_term' }),
1000
),
[trackApmEvent]
);
const history = useHistory();
const columns: Array<EuiBasicTableColumn<T>> = [
{
width: '100px',
field: 'score',
name: 'Score',
field: 'impact',
name: i18n.translate(
'xpack.apm.correlations.correlationsTable.impactLabel',
{ defaultMessage: 'Impact' }
),
render: (_: any, term: T) => {
return <EuiCode>{Math.round(term.score)}</EuiCode>;
return <ImpactBar value={term.impact * 100} />;
},
},
{
field: 'cardinality',
name: cardinalityColumnName,
field: 'percentage',
name: percentageColumnName,
render: (_: any, term: T) => {
const matches = asPercent(term.fgCount, term.bgCount);
return `${asInteger(term.fgCount)} (${matches})`;
return (
<EuiToolTip
position="right"
content={`${asInteger(term.valueCount)} / ${asInteger(
term.fieldCount
)}`}
>
<>{asPercent(term.valueCount, term.fieldCount)}</>
</EuiToolTip>
);
},
},
{
field: 'fieldName',
name: 'Field name',
name: i18n.translate(
'xpack.apm.correlations.correlationsTable.fieldNameLabel',
{ defaultMessage: 'Field name' }
),
},
{
field: 'fieldValue',
name: 'Field value',
name: i18n.translate(
'xpack.apm.correlations.correlationsTable.fieldValueLabel',
{ defaultMessage: 'Field value' }
),
render: (_: any, term: T) => String(term.fieldValue).slice(0, 50),
},
{
width: '100px',
actions: [
{
name: 'Focus',
description: 'Focus on this term',
name: i18n.translate(
'xpack.apm.correlations.correlationsTable.filterLabel',
{ defaultMessage: 'Filter' }
),
description: i18n.translate(
'xpack.apm.correlations.correlationsTable.filterDescription',
{ defaultMessage: 'Filter by value' }
),
icon: 'magnifyWithPlus',
type: 'icon',
onClick: (term: T) => {
Expand All @@ -80,11 +121,19 @@ export function SignificantTermsTable<T extends SignificantTerm>({
)}"`,
},
});
onFilter();
trackApmEvent({ metric: 'correlations_term_include_filter' });
},
},
{
name: 'Exclude',
description: 'Exclude this term',
name: i18n.translate(
'xpack.apm.correlations.correlationsTable.excludeLabel',
{ defaultMessage: 'Exclude' }
),
description: i18n.translate(
'xpack.apm.correlations.correlationsTable.excludeDescription',
{ defaultMessage: 'Filter out value' }
),
icon: 'magnifyWithMinus',
type: 'icon',
onClick: (term: T) => {
Expand All @@ -95,10 +144,15 @@ export function SignificantTermsTable<T extends SignificantTerm>({
)}"`,
},
});
onFilter();
trackApmEvent({ metric: 'correlations_term_exclude_filter' });
},
},
],
name: 'Actions',
name: i18n.translate(
'xpack.apm.correlations.correlationsTable.actionsLabel',
{ defaultMessage: 'Actions' }
),
render: (_: any, term: T) => {
return (
<>
Expand Down Expand Up @@ -134,15 +188,30 @@ export function SignificantTermsTable<T extends SignificantTerm>({
return (
<EuiBasicTable
items={significantTerms ?? []}
noItemsMessage={status === FETCH_STATUS.LOADING ? 'Loading' : 'No data'}
noItemsMessage={
status === FETCH_STATUS.LOADING ? loadingText : noDataText
}
loading={status === FETCH_STATUS.LOADING}
columns={columns}
rowProps={(term) => {
return {
onMouseEnter: () => setSelectedSignificantTerm(term),
onMouseEnter: () => {
setSelectedSignificantTerm(term);
trackSelectSignificantTerm();
},
onMouseLeave: () => setSelectedSignificantTerm(null),
};
}}
/>
);
}

const loadingText = i18n.translate(
'xpack.apm.correlations.correlationsTable.loadingText',
{ defaultMessage: 'Loading' }
);

const noDataText = i18n.translate(
'xpack.apm.correlations.correlationsTable.noDataText',
{ defaultMessage: 'No data' }
);
Loading