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] Break down transaction table api removing the sparklines #88946

Merged
merged 45 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f2a32af
removing pagination from server
cauemarcondes Jan 21, 2021
22b3729
new metrics api
cauemarcondes Jan 21, 2021
654928d
adding api tests
cauemarcondes Jan 25, 2021
284b39d
fixing TS
cauemarcondes Jan 25, 2021
d5b871d
new metrics api
cauemarcondes Jan 25, 2021
89b845c
fixing TS
cauemarcondes Jan 25, 2021
0a3b800
addressing PR comments
cauemarcondes Jan 26, 2021
8a10a56
addressing PR comments
cauemarcondes Jan 26, 2021
3eaf6b7
addressing PR comments
cauemarcondes Jan 26, 2021
a57e3ff
Merge branch 'master' of github.com:elastic/kibana into apm-transacti…
cauemarcondes Feb 1, 2021
aab9c33
addressing PR comments
cauemarcondes Feb 1, 2021
ad4f99d
adding API test
cauemarcondes Feb 1, 2021
bf9647f
changing how to calculate impact
cauemarcondes Feb 1, 2021
71ca8cd
Merge branch 'master' of github.com:elastic/kibana into apm-transacti…
cauemarcondes Feb 1, 2021
ca17de7
fixing conflicts
cauemarcondes Feb 1, 2021
502f709
caching result
cauemarcondes Feb 1, 2021
2967f65
Merge branch 'master' of github.com:elastic/kibana into apm-transacti…
cauemarcondes Feb 2, 2021
fa2ad69
addressing PR comments
cauemarcondes Feb 3, 2021
2b5f7d0
Merge branch 'master' of github.com:elastic/kibana into apm-transacti…
cauemarcondes Feb 3, 2021
dd58608
Merge branch 'master' of github.com:elastic/kibana into apm-transacti…
cauemarcondes Feb 4, 2021
9b4e84c
fixing license
cauemarcondes Feb 4, 2021
c725a6e
renaming
cauemarcondes Feb 4, 2021
51c66d9
using rate agg to calculate throughput
cauemarcondes Feb 4, 2021
a37637d
Removing unused variable
cauemarcondes Feb 5, 2021
80f12b8
addressing PR comments
cauemarcondes Feb 5, 2021
7ed0238
Merge branch 'apm-transaction-table-api' of github.com:cauemarcondes/…
cauemarcondes Feb 5, 2021
19b395f
addressing PR comments
cauemarcondes Feb 6, 2021
b38f92a
Merge branch 'master' of github.com:elastic/kibana into apm-transacti…
cauemarcondes Feb 6, 2021
2e7c224
fixing error rate
cauemarcondes Feb 6, 2021
8d33fb3
fixing eslint
cauemarcondes Feb 7, 2021
85e4b94
addressing PR comments
cauemarcondes Feb 8, 2021
a67632f
fixig TS issue
cauemarcondes Feb 8, 2021
b15cb64
Merge branch 'master' into apm-transaction-table-api
kibanamachine Feb 8, 2021
daf88fe
removing requestId
cauemarcondes Feb 9, 2021
6d10b2f
addressing PR comments
cauemarcondes Feb 9, 2021
90ccb07
Merge branch 'apm-transaction-table-api' of github.com:cauemarcondes/…
cauemarcondes Feb 9, 2021
21701f1
Merge branch 'master' of github.com:elastic/kibana into apm-transacti…
dgieselaar Feb 9, 2021
e1e2fb8
Merge branch 'master' of github.com:elastic/kibana into apm-transacti…
dgieselaar Feb 9, 2021
d0348c7
Merge branch 'apm-transaction-table-api' of github.com:cauemarcondes/…
dgieselaar Feb 9, 2021
e90fa6c
adding requestId
cauemarcondes Feb 10, 2021
ae5760e
Merge branch 'master' into apm-transaction-table-api
kibanamachine Feb 12, 2021
2c0305d
Merge branch 'apm-transaction-table-api' of github.com:cauemarcondes/…
dgieselaar Feb 12, 2021
4370be1
Revert "adding requestId"
dgieselaar Feb 12, 2021
c490067
Revert "removing requestId"
dgieselaar Feb 12, 2021
f7d2157
Support for transaction duration metrics
dgieselaar Feb 12, 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 @@ -80,21 +80,21 @@ describe('ServiceOverview', () => {
status: FETCH_STATUS.SUCCESS,
});

/* eslint-disable @typescript-eslint/naming-convention */
const calls = {
// eslint-disable-next-line @typescript-eslint/naming-convention
'GET /api/apm/services/{serviceName}/error_groups': {
error_groups: [],
total_error_groups: 0,
},
'GET /api/apm/services/{serviceName}/transactions/groups/overview': {
'GET /api/apm/services/{serviceName}/transactions/groups/primary_statistics': {
transactionGroups: [],
totalTransactionGroups: 0,
isAggregationAccurate: true,
},
'GET /api/apm/services/{serviceName}/dependencies': [],
// eslint-disable-next-line @typescript-eslint/naming-convention
'GET /api/apm/services/{serviceName}/service_overview_instances': [],
};
/* eslint-enable @typescript-eslint/naming-convention */

jest
.spyOn(callApmApiModule, 'createCallApmApi')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
/*
* 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 { EuiBasicTableColumn } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import { ValuesType } from 'utility-types';
import {
asMillisecondDuration,
asPercent,
asTransactionRate,
} from '../../../../../common/utils/formatters';
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
import { px, unit } from '../../../../style/variables';
import { SparkPlot } from '../../../shared/charts/spark_plot';
import { ImpactBar } from '../../../shared/ImpactBar';
import { TransactionDetailLink } from '../../../shared/Links/apm/transaction_detail_link';
import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip';

type TransactionGroupPrimaryStatistics = APIReturnType<'GET /api/apm/services/{serviceName}/transactions/groups/primary_statistics'>;

type ServiceTransactionGroupItem = ValuesType<
TransactionGroupPrimaryStatistics['transactionGroups']
>;
type TransactionGroupComparisonStatistics = APIReturnType<'GET /api/apm/services/{serviceName}/transactions/groups/comparison_statistics'>;

function getLatencyAggregationTypeLabel(latencyAggregationType?: string) {
cauemarcondes marked this conversation as resolved.
Show resolved Hide resolved
switch (latencyAggregationType) {
case 'avg':
return i18n.translate(
'xpack.apm.serviceOverview.transactionsTableColumnLatency.avg',
{ defaultMessage: 'Latency (avg.)' }
);

case 'p95':
return i18n.translate(
'xpack.apm.serviceOverview.transactionsTableColumnLatency.p95',
{ defaultMessage: 'Latency (95th)' }
);

case 'p99':
return i18n.translate(
'xpack.apm.serviceOverview.transactionsTableColumnLatency.p99',
{ defaultMessage: 'Latency (99th)' }
);
}
}

export function getColumns({
serviceName,
latencyAggregationType,
transactionGroupComparisonStatistics,
}: {
serviceName: string;
latencyAggregationType?: string;
transactionGroupComparisonStatistics?: TransactionGroupComparisonStatistics;
}): Array<EuiBasicTableColumn<ServiceTransactionGroupItem>> {
return [
{
field: 'name',
sortable: true,
name: i18n.translate(
'xpack.apm.serviceOverview.transactionsTableColumnName',
{ defaultMessage: 'Name' }
),
render: (_, { name, transactionType: type }) => {
return (
<TruncateWithTooltip
text={name}
content={
<TransactionDetailLink
serviceName={serviceName}
transactionName={name}
transactionType={type}
latencyAggregationType={latencyAggregationType}
>
{name}
</TransactionDetailLink>
}
/>
);
},
},
{
field: 'latency',
sortable: true,
name: getLatencyAggregationTypeLabel(latencyAggregationType),
width: px(unit * 10),
render: (_, { latency, name }) => {
const timeseries =
transactionGroupComparisonStatistics?.[name]?.latency;
return (
<SparkPlot
color="euiColorVis1"
compact
series={timeseries}
valueLabel={asMillisecondDuration(latency)}
/>
);
},
},
{
field: 'throughput',
sortable: true,
name: i18n.translate(
'xpack.apm.serviceOverview.transactionsTableColumnThroughput',
{ defaultMessage: 'Throughput' }
),
width: px(unit * 10),
render: (_, { throughput, name }) => {
const timeseries =
transactionGroupComparisonStatistics?.[name]?.throughput;
return (
<SparkPlot
color="euiColorVis0"
compact
series={timeseries}
valueLabel={asTransactionRate(throughput)}
/>
);
},
},
{
field: 'errorRate',
sortable: true,
name: i18n.translate(
'xpack.apm.serviceOverview.transactionsTableColumnErrorRate',
{ defaultMessage: 'Error rate' }
),
width: px(unit * 8),
render: (_, { errorRate, name }) => {
const timeseries =
transactionGroupComparisonStatistics?.[name]?.errorRate;
return (
<SparkPlot
color="euiColorVis7"
compact
series={timeseries}
valueLabel={asPercent(errorRate, 1)}
/>
);
},
},
{
field: 'impact',
sortable: true,
name: i18n.translate(
'xpack.apm.serviceOverview.transactionsTableColumnImpact',
{ defaultMessage: 'Impact' }
),
width: px(unit * 5),
render: (_, { name }) => {
const impact =
transactionGroupComparisonStatistics?.[name]?.impact ?? 0;
return <ImpactBar value={impact} size="m" />;
},
},
];
}
Loading