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] Add table tabs showing summary of metrics #153044

Merged
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
560e20e
update UI for tables tabs
MiriamAparicio Mar 8, 2023
4cda1da
added endpoint for main statistics
MiriamAparicio Mar 9, 2023
bc8259c
add endpoint detailed statistics
MiriamAparicio Mar 21, 2023
fcc8c82
create components for fields tables
MiriamAparicio Mar 21, 2023
288a836
pr review comments
MiriamAparicio Mar 22, 2023
414cea7
hide App launch time columns for IOS
MiriamAparicio Mar 24, 2023
b3121cc
added API basic test
MiriamAparicio Mar 24, 2023
c03dac7
rename tab param
MiriamAparicio Mar 24, 2023
e291660
Merge branch 'main' into 146877-mobile-tables-metrics
MiriamAparicio Mar 24, 2023
57f57be
Adding app.launch.time to mobile devices synthtrace
yngrdyn Mar 28, 2023
674e409
Merge branch 'main' into 146877-mobile-tables-metrics
yngrdyn Mar 28, 2023
4442319
renamed kueryWithMobileFilters to kuery
yngrdyn Mar 28, 2023
854319d
using startWithOffset and endWithOffset instead of start and end
yngrdyn Mar 28, 2023
b2d0611
Merge branch 'main' into 146877-mobile-tables-metrics
yngrdyn Apr 4, 2023
979934a
Merge branch 'main' into 146877-mobile-tables-metrics
yngrdyn Apr 6, 2023
65ea0d7
using asPercent to show crashRate
yngrdyn Apr 6, 2023
a1666e1
Adding crashes to synthtrace
yngrdyn Apr 6, 2023
6bb19f6
Merge remote-tracking branch 'upstream/main' into 146877-mobile-table…
MiriamAparicio Apr 10, 2023
bd46802
fix detailed statistics api test
MiriamAparicio Apr 10, 2023
e0061f9
Merge remote-tracking branch 'upstream/main' into 146877-mobile-table…
MiriamAparicio Apr 10, 2023
05d1ae4
added api test for detailed statistics
MiriamAparicio Apr 10, 2023
7c6ba18
Merge remote-tracking branch 'upstream/main' into 146877-mobile-table…
MiriamAparicio Apr 11, 2023
c00ed12
added e2e tests
MiriamAparicio Apr 11, 2023
ec047aa
change typing for mobile detailed statistics response)
MiriamAparicio Apr 11, 2023
cd68c3e
PR review comments
MiriamAparicio Apr 17, 2023
fd1bcbf
review api tests
MiriamAparicio Apr 17, 2023
d07d024
split main statistic request in transaction events and metrics
MiriamAparicio Apr 19, 2023
2e24a1a
Merge remote-tracking branch 'upstream/main' into 146877-mobile-table…
MiriamAparicio Apr 19, 2023
578b81e
fix api tests
MiriamAparicio Apr 19, 2023
9078127
rename operation request name
MiriamAparicio Apr 19, 2023
37443f2
fix types errors
MiriamAparicio Apr 20, 2023
581eb90
fix merging conflicts
MiriamAparicio Apr 20, 2023
072ab64
Merge remote-tracking branch 'upstream/main' into 146877-mobile-table…
MiriamAparicio Apr 21, 2023
f84d981
remove application launch time
MiriamAparicio Apr 21, 2023
a79ebaa
split main statistics query, use sources instead of events, i18n impr…
MiriamAparicio Apr 25, 2023
27f1bf9
Merge branch 'main' into 146877-mobile-tables-metrics
MiriamAparicio Apr 25, 2023
826f1bc
Merge branch 'main' into 146877-mobile-tables-metrics
MiriamAparicio Apr 25, 2023
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions x-pack/plugins/apm/common/es_fields/apm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const ERROR_EXC_MESSAGE = 'error.exception.message'; // only to be used i
export const ERROR_EXC_HANDLED = 'error.exception.handled'; // only to be used in es queries, since error.exception is now an array
export const ERROR_EXC_TYPE = 'error.exception.type';
export const ERROR_PAGE_URL = 'error.page.url';
export const ERROR_TYPE = 'error.type';

// METRICS
export const METRIC_SYSTEM_FREE_MEMORY = 'system.memory.actual.free';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import { useHistory } from 'react-router-dom';
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
import { useApmParams } from '../../../../hooks/use_apm_params';
import { useTimeRange } from '../../../../hooks/use_time_range';
import { TransactionsTable } from '../../../shared/transactions_table';
import { replace } from '../../../shared/links/url_helpers';
import { getKueryWithMobileFilters } from '../../../../../common/utils/get_kuery_with_mobile_filters';
import { MobileTransactionCharts } from './transaction_charts';
import { MobileTreemap } from '../charts/mobile_treemap';
import { TransactionOverviewTabs } from './transaction_overview_tabs';

export function MobileTransactionOverview() {
const {
Expand All @@ -37,6 +37,7 @@ export function MobileTransactionOverview() {
kuery,
offset,
comparisonEnabled,
mobileSelectedTab,
},
} = useApmParams('/mobile-services/{serviceName}/transactions');

Expand Down Expand Up @@ -88,15 +89,14 @@ export function MobileTransactionOverview() {
/>
<EuiSpacer size="s" />
<EuiPanel hasBorder={true}>
<TransactionsTable
hideViewTransactionsLink
numberOfTransactionsPerPage={25}
showMaxTransactionGroupsExceededWarning
<TransactionOverviewTabs
environment={environment}
kuery={kueryWithMobileFilters}
kueryWithMobileFilters={kueryWithMobileFilters}
yngrdyn marked this conversation as resolved.
Show resolved Hide resolved
start={start}
end={end}
saveTableOptionsToUrl
MiriamAparicio marked this conversation as resolved.
Show resolved Hide resolved
comparisonEnabled={comparisonEnabled}
offset={offset}
mobileSelectedTab={mobileSelectedTab}
/>
</EuiPanel>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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 { i18n } from '@kbn/i18n';
import { TabContentProps } from '.';
import { isPending } from '../../../../../hooks/use_fetcher';
import { StatsList } from './stats_list';
import { SERVICE_VERSION } from '../../../../../../common/es_fields/apm';
import { useMobileStatisticsFetcher } from './use_mobile_statistics_fetcher';

function AppVersionTab({
environment,
kueryWithMobileFilters,
start,
end,
comparisonEnabled,
offset,
}: TabContentProps) {
const {
agentName,
mainStatistics,
mainStatisticsStatus,
detailedStatistics,
detailedStatisticsStatus,
} = useMobileStatisticsFetcher({
field: SERVICE_VERSION,
environment,
kueryWithMobileFilters,
start,
end,
comparisonEnabled,
offset,
});

return (
<StatsList
agentName={agentName}
isLoading={isPending(mainStatisticsStatus)}
mainStatistics={mainStatistics}
detailedStatisticsLoading={isPending(detailedStatisticsStatus)}
detailedStatistics={detailedStatistics}
comparisonEnabled={comparisonEnabled}
offset={offset}
/>
);
}

export const appVersionTab = {
dataTestSubj: 'apmAppVersionTab',
key: 'app_version_tab',
label: i18n.translate(
'xpack.apm.mobile.transactions.overview.tabs.app.version',
{
defaultMessage: 'App version',
}
),
component: AppVersionTab,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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 { i18n } from '@kbn/i18n';
import { TabContentProps } from '.';
import { isPending } from '../../../../../hooks/use_fetcher';
import { StatsList } from './stats_list';
import { useMobileStatisticsFetcher } from './use_mobile_statistics_fetcher';
import { DEVICE_MODEL_IDENTIFIER } from '../../../../../../common/es_fields/apm';

function DevicesTab({
environment,
kueryWithMobileFilters,
start,
end,
comparisonEnabled,
offset,
}: TabContentProps) {
const {
agentName,
mainStatistics,
mainStatisticsStatus,
detailedStatistics,
detailedStatisticsStatus,
} = useMobileStatisticsFetcher({
field: DEVICE_MODEL_IDENTIFIER,
environment,
kueryWithMobileFilters,
start,
end,
comparisonEnabled,
offset,
});

return (
<StatsList
agentName={agentName}
isLoading={isPending(mainStatisticsStatus)}
mainStatistics={mainStatistics}
detailedStatisticsLoading={isPending(detailedStatisticsStatus)}
detailedStatistics={detailedStatistics}
comparisonEnabled={comparisonEnabled}
offset={offset}
/>
);
}

export const devicesTab = {
dataTestSubj: 'apmDevicesTab',
key: 'devices_tab',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: The key of the tabs can be an enum but up to you :)

label: i18n.translate('xpack.apm.mobile.transactions.overview.tabs.devices', {
defaultMessage: 'Devices',
}),
component: DevicesTab,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* 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 { useHistory } from 'react-router-dom';
import { EuiSpacer, EuiTabs, EuiTab } from '@elastic/eui';
import { push } from '../../../../shared/links/url_helpers';
import { transactionsTab } from './transactions_tab';
import { osVersionTab } from './os_version_tab';
import { appVersionTab } from './app_version_tab';
import { devicesTab } from './devices_tab';

export interface TabContentProps {
environment: string;
start: string;
end: string;
kueryWithMobileFilters: string;
comparisonEnabled: boolean;
offset?: string;
mobileSelectedTab?: string;
}

const tabs = [transactionsTab, appVersionTab, osVersionTab, devicesTab];

export function TransactionOverviewTabs({
environment,
start,
end,
kueryWithMobileFilters,
comparisonEnabled,
offset,
mobileSelectedTab,
}: TabContentProps) {
const history = useHistory();

const { component: TabContent } =
tabs.find((tab) => tab.key === mobileSelectedTab) ?? transactionsTab;
return (
<>
<EuiTabs>
{tabs.map(({ dataTestSubj, key, label }) => (
<EuiTab
data-test-subj={dataTestSubj}
key={key}
isSelected={key === mobileSelectedTab}
onClick={() => {
push(history, {
query: {
mobileSelectedTab: key,
},
});
}}
>
{label}
</EuiTab>
))}
</EuiTabs>
<EuiSpacer size="m" />
<TabContent
{...{
environment,
start,
end,
kueryWithMobileFilters,
comparisonEnabled,
offset,
}}
/>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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 { i18n } from '@kbn/i18n';
import { TabContentProps } from '.';
import { isPending } from '../../../../../hooks/use_fetcher';
import { StatsList } from './stats_list';
import { useMobileStatisticsFetcher } from './use_mobile_statistics_fetcher';
import { HOST_OS_VERSION } from '../../../../../../common/es_fields/apm';

function OSVersionTab({
environment,
kueryWithMobileFilters,
start,
end,
comparisonEnabled,
offset,
}: TabContentProps) {
const {
agentName,
mainStatistics,
mainStatisticsStatus,
detailedStatistics,
detailedStatisticsStatus,
} = useMobileStatisticsFetcher({
field: HOST_OS_VERSION,
environment,
kueryWithMobileFilters,
start,
end,
comparisonEnabled,
offset,
});

return (
<StatsList
agentName={agentName}
isLoading={isPending(mainStatisticsStatus)}
mainStatistics={mainStatistics}
detailedStatisticsLoading={isPending(detailedStatisticsStatus)}
detailedStatistics={detailedStatistics}
comparisonEnabled={comparisonEnabled}
offset={offset}
/>
);
}

export const osVersionTab = {
dataTestSubj: 'apmOsVersionTab',
key: 'os_version_tab',
label: i18n.translate(
'xpack.apm.mobile.transactions.overview.tabs.os.version',
{
defaultMessage: 'OS version',
}
),
component: OSVersionTab,
};
Loading