|
@@ -53,15 +53,17 @@ function ProfilingContent({location}: ProfilingContentProps) {
|
|
|
const cursor = decodeScalar(location.query.cursor);
|
|
|
const query = decodeScalar(location.query.query, '');
|
|
|
|
|
|
- const sort = formatSort<FieldType>(decodeScalar(location.query.sort), FIELDS, {
|
|
|
- key: 'p99()',
|
|
|
- order: 'desc',
|
|
|
- });
|
|
|
-
|
|
|
const profilingUsingTransactions = organization.features.includes(
|
|
|
'profiling-using-transactions'
|
|
|
);
|
|
|
|
|
|
+ const fields = profilingUsingTransactions ? ALL_FIELDS : BASE_FIELDS;
|
|
|
+
|
|
|
+ const sort = formatSort<FieldType>(decodeScalar(location.query.sort), fields, {
|
|
|
+ key: 'p99()',
|
|
|
+ order: 'desc',
|
|
|
+ });
|
|
|
+
|
|
|
const profileFilters = useProfileFilters({
|
|
|
query: '',
|
|
|
selection,
|
|
@@ -71,7 +73,7 @@ function ProfilingContent({location}: ProfilingContentProps) {
|
|
|
|
|
|
const transactions = useProfileEvents<FieldType>({
|
|
|
cursor,
|
|
|
- fields: FIELDS,
|
|
|
+ fields,
|
|
|
query,
|
|
|
sort,
|
|
|
referrer: 'api.profiling.landing-table',
|
|
@@ -254,7 +256,7 @@ function ProfilingContent({location}: ProfilingContentProps) {
|
|
|
/>
|
|
|
)}
|
|
|
<ProfileEventsTable
|
|
|
- columns={FIELDS.slice()}
|
|
|
+ columns={fields.slice()}
|
|
|
data={transactions.status === 'success' ? transactions.data[0] : null}
|
|
|
error={
|
|
|
transactions.status === 'error'
|
|
@@ -263,7 +265,7 @@ function ProfilingContent({location}: ProfilingContentProps) {
|
|
|
}
|
|
|
isLoading={transactions.status === 'loading'}
|
|
|
sort={sort}
|
|
|
- sortableColumns={new Set(FIELDS)}
|
|
|
+ sortableColumns={new Set(fields)}
|
|
|
/>
|
|
|
<Pagination
|
|
|
pageLinks={
|
|
@@ -282,7 +284,7 @@ function ProfilingContent({location}: ProfilingContentProps) {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-const FIELDS = [
|
|
|
+const BASE_FIELDS = [
|
|
|
'transaction',
|
|
|
'project.id',
|
|
|
'last_seen()',
|
|
@@ -292,7 +294,10 @@ const FIELDS = [
|
|
|
'count()',
|
|
|
] as const;
|
|
|
|
|
|
-type FieldType = (typeof FIELDS)[number];
|
|
|
+// user misery is only available with the profiling-using-transactions feature
|
|
|
+const ALL_FIELDS = [...BASE_FIELDS, 'user_misery()'] as const;
|
|
|
+
|
|
|
+type FieldType = (typeof ALL_FIELDS)[number];
|
|
|
|
|
|
const ActionBar = styled('div')`
|
|
|
display: grid;
|