) : null;
diff --git a/components/tx-data/index.tsx b/components/tx-data/index.tsx
index 6aa33b8..f4a48ee 100644
--- a/components/tx-data/index.tsx
+++ b/components/tx-data/index.tsx
@@ -4,6 +4,8 @@ import { useTx } from "@/hooks/api";
import { sequenceDiagramFromSpans } from "@/lib/mermaid";
import { useState } from "react";
import Mermaid from "../mermaid";
+import { Badge } from "../ui/badge";
+import SpanDetails from "./span-details";
type TxDataProps = {
txId: string;
@@ -22,19 +24,16 @@ export default function TxData({ txId, spanId }: TxDataProps) {
const span = tx.spans.find((span) => span.spanId === spanIdToFind);
return (
-
+
+
+
+ Transaction {txId}
+
+
{!isFetching ? (
) : null}
- {span ? (
-
- {JSON.stringify(
- Object.fromEntries(Array.from(span.tags).sort()),
- null,
- 2,
- )}
-
- ) : null}
+ {span ?
: null}
);
}
diff --git a/components/tx-data/span-details.tsx b/components/tx-data/span-details.tsx
new file mode 100644
index 0000000..d2d4d3d
--- /dev/null
+++ b/components/tx-data/span-details.tsx
@@ -0,0 +1,38 @@
+import JsonTreeViewer from "@/lib/json-tree";
+import { getParsedSpanMap } from "@/lib/parse-span";
+import { cn } from "@/lib/utils";
+import { Span } from "@/types/txs";
+import { Table, TableBody, TableCell, TableRow } from "../ui/table";
+
+type SpanDetailsProps = {
+ span: Span;
+};
+
+export default function SpanDetails({ span }: SpanDetailsProps) {
+ const parsedSpan = getParsedSpanMap(span);
+
+ return (
+
+
+
Relevant operation info:
+
+
+ {Array.from(parsedSpan.entries()).map(([key, value], i) => (
+
+ {key}
+ {value}
+
+ ))}
+
+
+
+
+
Full operation info:
+
+
+
+ );
+}
diff --git a/components/tx-data/tx-sheet.tsx b/components/tx-data/tx-sheet.tsx
index a4e5e42..f2e42f9 100644
--- a/components/tx-data/tx-sheet.tsx
+++ b/components/tx-data/tx-sheet.tsx
@@ -16,7 +16,9 @@ export default function TxSheet({ children }: PropsWithChildren) {
}
}}
>
-
{children}
+
+ {children}
+
);
}
diff --git a/components/txs-table/index.tsx b/components/txs-table/index.tsx
index bb8d68f..4aa5013 100644
--- a/components/txs-table/index.tsx
+++ b/components/txs-table/index.tsx
@@ -52,11 +52,14 @@ export function TxsTable() {
),
cell: ({ row }) => (
-
- {(row.getValue("spans") as readonly Span[])
- .map((span) => span.tags.get(tagKey))
- .filter((span) => !!span)
- .join(" | ")}
+
+ {Array.from(
+ new Set(
+ (row.getValue("spans") as readonly Span[])
+ .map((span) => span.tags.get(tagKey))
+ .filter((span) => !!span),
+ ),
+ ).join(" | ")}
),
//NOTE - Don't UI filter, query API
diff --git a/components/txs-table/txs-columns.tsx b/components/txs-table/txs-columns.tsx
index ba65141..d3a8f51 100644
--- a/components/txs-table/txs-columns.tsx
+++ b/components/txs-table/txs-columns.tsx
@@ -11,10 +11,10 @@ export const txsColumns: ColumnDef
[] = [
cell: ({ row }) => {
const startDate = new Date(Number(row.getValue("startTime")) / 1000);
return (
-
- {startDate.toLocaleTimeString() +
- " - " +
- startDate.toLocaleDateString()}
+
+ {startDate.toLocaleTimeString()}
+
+ {startDate.toLocaleDateString()}
);
},
@@ -26,16 +26,21 @@ export const txsColumns: ColumnDef
[] = [
header: ({ column }) => (
),
- cell: ({ row }) => (
-
- {row.getValue("traceId")}
-
- ),
+ cell: ({ row }) => {
+ const traceId: string = row.getValue("traceId");
+ return (
+
+ {traceId.slice(0, 4)}
+ {traceId.slice(4, 28)}
+ {traceId.slice(28)}
+
+ );
+ },
enableSorting: false,
enableHiding: false,
},
{
- accessorKey: "spans",
+ accessorKey: "operationName",
header: () => null,
cell: () => null,
//NOTE - Don't UI filter, query API
@@ -43,7 +48,7 @@ export const txsColumns: ColumnDef[] = [
enableHiding: false,
},
{
- accessorKey: "operationName",
+ accessorKey: "tags",
header: () => null,
cell: () => null,
//NOTE - Don't UI filter, query API
@@ -51,10 +56,9 @@ export const txsColumns: ColumnDef[] = [
enableHiding: false,
},
{
- accessorKey: "tags",
+ accessorKey: "spans",
header: () => null,
cell: () => null,
- //NOTE - Don't UI filter, query API
filterFn: () => true,
enableHiding: false,
},
diff --git a/components/txs-table/txs-table-toolbar.tsx b/components/txs-table/txs-table-toolbar.tsx
index d713b29..cad8fa0 100644
--- a/components/txs-table/txs-table-toolbar.tsx
+++ b/components/txs-table/txs-table-toolbar.tsx
@@ -49,8 +49,8 @@ export function DataTableToolbar({
table,
}: DataTableToolbarProps) {
return (
-
-
+
+