-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(overlay): Enhanced Trace detail page. (#557)
- Loading branch information
1 parent
4be6666
commit aba5c07
Showing
18 changed files
with
194 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@spotlightjs/overlay': minor | ||
--- | ||
|
||
- Added subtabs in trace detail page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 0 additions & 109 deletions
109
packages/overlay/src/integrations/sentry/components/traces/TraceDetails.tsx
This file was deleted.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
...verlay/src/integrations/sentry/components/traces/TraceDetails/components/TraceContext.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import sentryDataCache from '~/integrations/sentry/data/sentryDataCache'; | ||
import type { Tags as TagsType, Trace } from '~/integrations/sentry/types'; | ||
import { getDuration } from '~/integrations/sentry/utils/duration'; | ||
import DateTime from '../../../DateTime'; | ||
import Tags from '../../../Tags'; | ||
|
||
type TraceGeneralInfoProps = { | ||
trace: Trace; | ||
}; | ||
|
||
function TraceGeneralInfo({ trace }: TraceGeneralInfoProps) { | ||
const traceId = trace.trace_id; | ||
return ( | ||
<div> | ||
<h2 className="mb-2 font-bold uppercase">General</h2> | ||
<table className="w-full text-sm"> | ||
<tbody> | ||
{[ | ||
['Trace Id', traceId || '-'], | ||
['Spans', trace.spans.length || '-'], | ||
['Transactions', trace.transactions.length || '-'], | ||
['Errors', trace.errors || '-'], | ||
[ | ||
'Start Timestamp', | ||
trace.start_timestamp ? <DateTime key="Start Timestamp" date={trace.start_timestamp} /> : '-', | ||
], | ||
['Total Duration', `${getDuration(trace.start_timestamp, trace.timestamp).toLocaleString()} ms`], | ||
].map(([key, value]) => ( | ||
<tr key={key as string} className="text-primary-300"> | ||
<th className=" w-1/12 py-0.5 pr-4 text-left font-mono font-normal"> | ||
<div className="w-full truncate">{key}</div> | ||
</th> | ||
<td className="py-0.5"> | ||
<pre className="whitespace-nowrap font-mono">{value}</pre> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
); | ||
} | ||
|
||
type TraceTagsProps = { | ||
trace: Trace; | ||
}; | ||
|
||
function TraceTags({ trace }: TraceTagsProps) { | ||
const tags: TagsType = trace.transactions | ||
.map(tsx => tsx.tags || {}) | ||
.reduce((prev, current) => Object.assign(prev, current), {} as TagsType); | ||
|
||
return ( | ||
Object.keys(tags).length > 0 && ( | ||
<div> | ||
<h2 className="mb-2 font-bold uppercase">Tags</h2> | ||
<Tags tags={tags} /> | ||
</div> | ||
) | ||
); | ||
} | ||
|
||
type TraceContextProps = { | ||
traceId: string; | ||
}; | ||
|
||
export default function TraceContext({ traceId }: TraceContextProps) { | ||
const trace = sentryDataCache.getTraceById(traceId); | ||
|
||
return ( | ||
<div className="space-y-4 px-6 py-4"> | ||
<TraceGeneralInfo trace={trace} /> | ||
<TraceTags trace={trace} /> | ||
</div> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
...y/src/integrations/sentry/components/traces/TraceDetails/components/TraceDetailHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Trace } from '../../../../types'; | ||
import TraceIcon from '../../TraceIcon'; | ||
|
||
type TraceDetailHeaderProps = { | ||
trace: Trace; | ||
}; | ||
|
||
export default function TraceDetailHeader({ trace }: TraceDetailHeaderProps) { | ||
return ( | ||
<div className="border-b-primary-700 bg-primary-950 flex items-center gap-x-2 border-b px-6 py-4"> | ||
<TraceIcon trace={trace} /> | ||
<h1 className="max-w-full flex-1 truncate text-2xl">{trace.rootTransactionName}</h1> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.