|
@@ -10,9 +10,13 @@ import GridEditable, {
|
|
|
import SortLink from 'sentry/components/gridEditable/sortLink';
|
|
|
import Link from 'sentry/components/links/link';
|
|
|
import Pagination, {CursorHandler} from 'sentry/components/pagination';
|
|
|
+import {Organization} from 'sentry/types';
|
|
|
+import {MetaType} from 'sentry/utils/discover/eventView';
|
|
|
+import {getFieldRenderer} from 'sentry/utils/discover/fieldRenderers';
|
|
|
import type {Sort} from 'sentry/utils/discover/fields';
|
|
|
import {decodeScalar} from 'sentry/utils/queryString';
|
|
|
import {useLocation} from 'sentry/utils/useLocation';
|
|
|
+import useOrganization from 'sentry/utils/useOrganization';
|
|
|
import CountCell from 'sentry/views/starfish/components/tableCells/countCell';
|
|
|
import DurationCell from 'sentry/views/starfish/components/tableCells/durationCell';
|
|
|
import ThroughputCell from 'sentry/views/starfish/components/tableCells/throughputCell';
|
|
@@ -74,10 +78,11 @@ export default function SpansTable({
|
|
|
limit = 25,
|
|
|
}: Props) {
|
|
|
const location = useLocation();
|
|
|
+ const organization = useOrganization();
|
|
|
|
|
|
const spansCursor = decodeScalar(location.query?.[QueryParameterNames.CURSOR]);
|
|
|
|
|
|
- const {isLoading, data, pageLinks} = useSpanList(
|
|
|
+ const {isLoading, data, meta, pageLinks} = useSpanList(
|
|
|
moduleName ?? ModuleName.ALL,
|
|
|
undefined,
|
|
|
spanCategory,
|
|
@@ -109,7 +114,7 @@ export default function SpansTable({
|
|
|
grid={{
|
|
|
renderHeadCell: column => renderHeadCell(column, sort, location),
|
|
|
renderBodyCell: (column, row) =>
|
|
|
- renderBodyCell(column, row, location, endpoint, method),
|
|
|
+ renderBodyCell(column, row, meta, location, organization, endpoint, method),
|
|
|
}}
|
|
|
location={location}
|
|
|
/>
|
|
@@ -141,7 +146,9 @@ function renderHeadCell(column: Column, sort: Sort, location: Location) {
|
|
|
function renderBodyCell(
|
|
|
column: Column,
|
|
|
row: Row,
|
|
|
+ meta: MetaType | undefined,
|
|
|
location: Location,
|
|
|
+ organization: Organization,
|
|
|
endpoint?: string,
|
|
|
method?: string
|
|
|
): React.ReactNode {
|
|
@@ -173,33 +180,25 @@ function renderBodyCell(
|
|
|
}
|
|
|
|
|
|
if (column.key === 'sps()') {
|
|
|
- return (
|
|
|
- <ThroughputCell
|
|
|
- throughputPerSecond={row['sps()']}
|
|
|
- delta={row['sps_percent_change()']}
|
|
|
- />
|
|
|
- );
|
|
|
+ return <ThroughputCell throughputPerSecond={row['sps()']} />;
|
|
|
}
|
|
|
|
|
|
if (column.key === 'p95(span.self_time)') {
|
|
|
- return (
|
|
|
- <DurationCell
|
|
|
- milliseconds={row['p95(span.self_time)']}
|
|
|
- delta={row['percentile_percent_change(span.self_time, 0.95)']}
|
|
|
- />
|
|
|
- );
|
|
|
+ return <DurationCell milliseconds={row['p95(span.self_time)']} />;
|
|
|
}
|
|
|
|
|
|
if (column.key === 'http_error_count()') {
|
|
|
- return (
|
|
|
- <CountCell
|
|
|
- count={row['http_error_count()']}
|
|
|
- delta={row['http_error_count_percent_change()']}
|
|
|
- />
|
|
|
- );
|
|
|
+ return <CountCell count={row['http_error_count()']} />;
|
|
|
}
|
|
|
|
|
|
- return row[column.key];
|
|
|
+ if (!meta || !meta?.fields) {
|
|
|
+ return row[column.key];
|
|
|
+ }
|
|
|
+
|
|
|
+ const renderer = getFieldRenderer(column.key, meta, false);
|
|
|
+ const rendered = renderer(row, {location, organization});
|
|
|
+
|
|
|
+ return rendered;
|
|
|
}
|
|
|
|
|
|
function getDomainHeader(moduleName: ModuleName) {
|
|
@@ -249,12 +248,22 @@ function getColumns(moduleName: ModuleName): Column[] {
|
|
|
{
|
|
|
key: 'sps()',
|
|
|
name: 'Throughput',
|
|
|
- width: 175,
|
|
|
+ width: COL_WIDTH_UNDEFINED,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'sps_percent_change()',
|
|
|
+ name: DataTitles.change,
|
|
|
+ width: COL_WIDTH_UNDEFINED,
|
|
|
},
|
|
|
{
|
|
|
key: `p95(${SPAN_SELF_TIME})`,
|
|
|
name: DataTitles.p95,
|
|
|
- width: 175,
|
|
|
+ width: COL_WIDTH_UNDEFINED,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: `percentile_percent_change(${SPAN_SELF_TIME}, 0.95)`,
|
|
|
+ name: DataTitles.change,
|
|
|
+ width: COL_WIDTH_UNDEFINED,
|
|
|
},
|
|
|
...(moduleName === ModuleName.HTTP
|
|
|
? [
|
|
@@ -263,6 +272,11 @@ function getColumns(moduleName: ModuleName): Column[] {
|
|
|
name: DataTitles.errorCount,
|
|
|
width: COL_WIDTH_UNDEFINED,
|
|
|
} as Column,
|
|
|
+ {
|
|
|
+ key: 'http_error_count_percent_change()',
|
|
|
+ name: DataTitles.change,
|
|
|
+ width: COL_WIDTH_UNDEFINED,
|
|
|
+ } as Column,
|
|
|
]
|
|
|
: []),
|
|
|
{
|