File tree Expand file tree Collapse file tree 2 files changed +26
-18
lines changed
static/app/views/performance/newTraceDetails Expand file tree Collapse file tree 2 files changed +26
-18
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,30 @@ interface TitleProps {
2525 tree : TraceTree ;
2626}
2727
28+ function getTitle (
29+ tree : TraceTree ,
30+ representativeEvent : RepresentativeTraceEvent
31+ ) : {
32+ title : string ;
33+ subtitle ?: string ;
34+ } | null {
35+ const { event} = representativeEvent ;
36+ if ( ! event ) {
37+ return null ;
38+ }
39+
40+ // Handle log events
41+ if ( OurLogKnownFieldKey . SEVERITY in event ) {
42+ return {
43+ title : t ( 'Trace' ) ,
44+ subtitle : event [ OurLogKnownFieldKey . MESSAGE ] ,
45+ } ;
46+ }
47+
48+ const node = tree . root . findChild ( n => n . value === event ) ;
49+ return node ?. traceHeaderTitle ?? null ;
50+ }
51+
2852function ContextBadges ( { rootEventResults} : Pick < TitleProps , 'rootEventResults' > ) {
2953 const organization = useOrganization ( ) ;
3054
@@ -68,23 +92,7 @@ const ReplayButton = styled(LinkButton)`
6892` ;
6993
7094export function Title ( { representativeEvent, rootEventResults, tree} : TitleProps ) {
71- let traceTitle : { title : string ; subtitle ?: string } | null = null ;
72-
73- // Handle log events, they are not a part of the trace tree
74- if (
75- representativeEvent ?. event &&
76- OurLogKnownFieldKey . SEVERITY in representativeEvent . event
77- ) {
78- traceTitle = {
79- title : t ( 'Trace' ) ,
80- subtitle : representativeEvent . event [ OurLogKnownFieldKey . MESSAGE ] ,
81- } ;
82- } else {
83- const node = tree . root . findChild ( n => n . value === representativeEvent . event ) ;
84- if ( node ) {
85- traceTitle = node . traceHeaderTitle ;
86- }
87- }
95+ const traceTitle = getTitle ( tree , representativeEvent ) ;
8896
8997 return (
9098 < div >
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export function TraceEAPSpanRow(props: TraceRowProps<EapSpanNode>) {
7474 ) }
7575 < span className = "TraceDescription" title = { props . node . description } >
7676 { props . node . description
77- ? ellipsize ( props . node . value . transaction , 100 )
77+ ? ellipsize ( props . node . description , 100 )
7878 : ( spanId ?? 'unknown' ) }
7979 </ span >
8080 </ React . Fragment >
You can’t perform that action at this time.
0 commit comments