|
@@ -1,6 +1,8 @@
|
|
|
import {RouteComponentProps} from 'react-router';
|
|
|
import styled from '@emotion/styled';
|
|
|
+import omit from 'lodash/omit';
|
|
|
|
|
|
+import {Button} from 'sentry/components/button';
|
|
|
import DatePageFilter from 'sentry/components/datePageFilter';
|
|
|
import * as Layout from 'sentry/components/layouts/thirds';
|
|
|
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
|
|
@@ -32,11 +34,13 @@ type Props = {
|
|
|
|
|
|
function SpanSummaryPage({params, location}: Props) {
|
|
|
const {groupId} = params;
|
|
|
- const {transaction} = location.query;
|
|
|
+ const {transaction, endpoint} = location.query;
|
|
|
+
|
|
|
+ const queryFilter = endpoint ? {transactionName: endpoint} : undefined;
|
|
|
|
|
|
const {data: spanMetas} = useSpanMeta(
|
|
|
groupId,
|
|
|
- undefined,
|
|
|
+ queryFilter,
|
|
|
'span-summary-page-span-meta'
|
|
|
);
|
|
|
// TODO: Span meta might in theory return more than one row! In that case, we
|
|
@@ -49,7 +53,7 @@ function SpanSummaryPage({params, location}: Props) {
|
|
|
|
|
|
const {data: spanMetrics} = useSpanMetrics(
|
|
|
{group: groupId},
|
|
|
- undefined,
|
|
|
+ queryFilter,
|
|
|
['sps()', 'sum(span.duration)', 'p95(span.duration)', 'time_spent_percentage()'],
|
|
|
'span-summary-page-metrics'
|
|
|
);
|
|
@@ -57,7 +61,7 @@ function SpanSummaryPage({params, location}: Props) {
|
|
|
const {isLoading: areSpanMetricsSeriesLoading, data: spanMetricsSeriesData} =
|
|
|
useSpanMetricsSeries(
|
|
|
{group: groupId},
|
|
|
- undefined,
|
|
|
+ queryFilter,
|
|
|
['p95(span.duration)', 'sps()'],
|
|
|
'sidebar-span-metrics'
|
|
|
);
|
|
@@ -70,37 +74,39 @@ function SpanSummaryPage({params, location}: Props) {
|
|
|
<PageErrorProvider>
|
|
|
<Layout.Header>
|
|
|
<Layout.HeaderContent>
|
|
|
- <Layout.Title> Span Summary </Layout.Title>
|
|
|
- </Layout.HeaderContent>{' '}
|
|
|
+ <Layout.Title>{t('Span Summary')}</Layout.Title>
|
|
|
+ </Layout.HeaderContent>
|
|
|
</Layout.Header>
|
|
|
<Layout.Body>
|
|
|
<Layout.Main fullWidth>
|
|
|
<PageErrorAlert />
|
|
|
- <FilterOptionsContainer>
|
|
|
- <DatePageFilter alignDropdown="left" />
|
|
|
- </FilterOptionsContainer>
|
|
|
<BlockContainer>
|
|
|
- <Block title={t('Operation')}>{span?.['span.op']}</Block>
|
|
|
- <Block
|
|
|
- title={t('Throughput')}
|
|
|
- description={t('Throughput of this span per second')}
|
|
|
- >
|
|
|
- <ThroughputCell throughputPerSecond={spanMetrics?.['sps()']} />
|
|
|
- </Block>
|
|
|
- <Block title={t('Duration')} description={t('Time spent in this span')}>
|
|
|
- <DurationCell milliseconds={spanMetrics?.['p95(span.duration)']} />
|
|
|
- </Block>
|
|
|
- <Block
|
|
|
- title={t('Time Spent')}
|
|
|
- description={t(
|
|
|
- 'Time spent in this span as a proportion of total application time'
|
|
|
- )}
|
|
|
- >
|
|
|
- <TimeSpentCell
|
|
|
- timeSpentPercentage={spanMetrics?.['time_spent_percentage()']}
|
|
|
- totalSpanTime={spanMetrics?.['sum(span.duration)']}
|
|
|
- />
|
|
|
- </Block>
|
|
|
+ <FilterOptionsContainer>
|
|
|
+ <DatePageFilter alignDropdown="left" />
|
|
|
+ </FilterOptionsContainer>
|
|
|
+ <BlockContainer>
|
|
|
+ <Block title={t('Operation')}>{span?.['span.op']}</Block>
|
|
|
+ <Block
|
|
|
+ title={t('Throughput')}
|
|
|
+ description={t('Throughput of this span per second')}
|
|
|
+ >
|
|
|
+ <ThroughputCell throughputPerSecond={spanMetrics?.['sps()']} />
|
|
|
+ </Block>
|
|
|
+ <Block title={t('Duration')} description={t('Time spent in this span')}>
|
|
|
+ <DurationCell milliseconds={spanMetrics?.['p95(span.duration)']} />
|
|
|
+ </Block>
|
|
|
+ <Block
|
|
|
+ title={t('Time Spent')}
|
|
|
+ description={t(
|
|
|
+ 'Time spent in this span as a proportion of total application time'
|
|
|
+ )}
|
|
|
+ >
|
|
|
+ <TimeSpentCell
|
|
|
+ timeSpentPercentage={spanMetrics?.['time_spent_percentage()']}
|
|
|
+ totalSpanTime={spanMetrics?.['sum(span.duration)']}
|
|
|
+ />
|
|
|
+ </Block>
|
|
|
+ </BlockContainer>
|
|
|
</BlockContainer>
|
|
|
|
|
|
{span?.['span.description'] && (
|
|
@@ -151,7 +157,17 @@ function SpanSummaryPage({params, location}: Props) {
|
|
|
</BlockContainer>
|
|
|
)}
|
|
|
|
|
|
- {span && <SpanTransactionsTable span={span} />}
|
|
|
+ {span && <SpanTransactionsTable span={span} endpoint={endpoint} />}
|
|
|
+ {endpoint && (
|
|
|
+ <Button
|
|
|
+ to={{
|
|
|
+ pathname: location.pathname,
|
|
|
+ query: omit(location.query, 'endpoint'),
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {t('View More Endpoints')}
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
|
|
|
{transaction && span?.group && (
|
|
|
<SampleList groupId={span.group} transactionName={transaction} />
|
|
@@ -169,7 +185,7 @@ const FilterOptionsContainer = styled('div')`
|
|
|
flex-direction: row;
|
|
|
gap: ${space(1)};
|
|
|
align-items: center;
|
|
|
- margin-bottom: ${space(2)};
|
|
|
+ flex: 1;
|
|
|
`;
|
|
|
|
|
|
type BlockProps = {
|
|
@@ -199,6 +215,7 @@ const BlockTitle = styled('h3')`
|
|
|
font-size: ${p => p.theme.fontSizeMedium};
|
|
|
margin: 0;
|
|
|
margin-bottom: ${space(1)};
|
|
|
+ white-space: nowrap;
|
|
|
`;
|
|
|
|
|
|
const BlockContent = styled('h4')`
|