diff --git a/app/src/pages/trace/TraceDetails.tsx b/app/src/pages/trace/TraceDetails.tsx index 0c6b09f68b..6d14a32fea 100644 --- a/app/src/pages/trace/TraceDetails.tsx +++ b/app/src/pages/trace/TraceDetails.tsx @@ -1,12 +1,12 @@ import React, { PropsWithChildren, Suspense, useEffect, useMemo } from "react"; import { graphql, useLazyLoadQuery } from "react-relay"; import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels"; -import { useSearchParams } from "react-router-dom"; +import { useParams, useSearchParams } from "react-router-dom"; import { css } from "@emotion/react"; -import { Flex, Text, View } from "@arizeai/components"; +import { Flex, Icon, Icons, Text, View } from "@arizeai/components"; -import { Loading } from "@phoenix/components"; +import { Link, Loading } from "@phoenix/components"; import { AnnotationLabel, AnnotationTooltip, @@ -64,6 +64,7 @@ export function TraceDetails(props: TraceDetailsProps) { project: node(id: $id) { ... on Project { trace(traceId: $traceId) { + projectSessionId spans(first: 1000) { edges { span: node { @@ -113,7 +114,7 @@ export function TraceDetails(props: TraceDetailsProps) { return () => { setSearchParams( (searchParams) => { - searchParams.delete("spanNodeId"); + searchParams.delete(SELECTED_SPAN_NODE_ID_URL_PARAM); return searchParams; }, { replace: true } @@ -131,7 +132,10 @@ export function TraceDetails(props: TraceDetailsProps) { flex-direction: column; `} > - + - + Trace Status @@ -233,6 +244,19 @@ function TraceHeader({ rootSpan }: { rootSpan: Span | null }) { ) : null} + {sessionId && ( + + + + View Session } /> + + + + )} ); diff --git a/app/src/pages/trace/__generated__/TraceDetailsQuery.graphql.ts b/app/src/pages/trace/__generated__/TraceDetailsQuery.graphql.ts index cf6d04a2a4..d7e044cd19 100644 --- a/app/src/pages/trace/__generated__/TraceDetailsQuery.graphql.ts +++ b/app/src/pages/trace/__generated__/TraceDetailsQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<05ddaf3cf129db9abc342c1c612a4b46>> * @lightSyntaxTransform * @nogrep */ @@ -19,6 +19,7 @@ export type TraceDetailsQuery$variables = { export type TraceDetailsQuery$data = { readonly project: { readonly trace?: { + readonly projectSessionId: string | null; readonly spans: { readonly edges: ReadonlyArray<{ readonly span: { @@ -102,6 +103,13 @@ v5 = { "name": "trace", "plural": false, "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "projectSessionId", + "storageKey": null + }, { "alias": null, "args": [ @@ -326,16 +334,16 @@ return { ] }, "params": { - "cacheID": "22103e9bb1f983529081ca93d60e76ef", + "cacheID": "5ac539f9f161693ada371b5d0e55f17f", "id": null, "metadata": {}, "name": "TraceDetailsQuery", "operationKind": "query", - "text": "query TraceDetailsQuery(\n $traceId: ID!\n $id: GlobalID!\n) {\n project: node(id: $id) {\n __typename\n ... on Project {\n trace(traceId: $traceId) {\n spans(first: 1000) {\n edges {\n span: node {\n id\n context {\n spanId\n traceId\n }\n name\n spanKind\n statusCode: propagatedStatusCode\n startTime\n parentId\n latencyMs\n tokenCountTotal\n tokenCountPrompt\n tokenCountCompletion\n spanAnnotations {\n name\n label\n score\n annotatorKind\n }\n }\n }\n }\n }\n }\n __isNode: __typename\n id\n }\n}\n" + "text": "query TraceDetailsQuery(\n $traceId: ID!\n $id: GlobalID!\n) {\n project: node(id: $id) {\n __typename\n ... on Project {\n trace(traceId: $traceId) {\n projectSessionId\n spans(first: 1000) {\n edges {\n span: node {\n id\n context {\n spanId\n traceId\n }\n name\n spanKind\n statusCode: propagatedStatusCode\n startTime\n parentId\n latencyMs\n tokenCountTotal\n tokenCountPrompt\n tokenCountCompletion\n spanAnnotations {\n name\n label\n score\n annotatorKind\n }\n }\n }\n }\n }\n }\n __isNode: __typename\n id\n }\n}\n" } }; })(); -(node as any).hash = "8b568616f23f7d349cac5a31807463fb"; +(node as any).hash = "69f82cff480af6a8d9e0cc0bb393d3e3"; export default node;