feat(dashboard): traces timeline ui#4056
feat(dashboard): traces timeline ui#4056jog1t wants to merge 1 commit into02-04-fix_traces_separate_entrypointsfrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: Traces Timeline UIThis PR adds a new timeline view for visualizing actor traces in the dashboard. The implementation is comprehensive and includes several sophisticated features like gap detection and time compression. Here's my detailed review: Code Quality & ArchitectureStrengths:
Issues:
The export type SpanNode = {
timeUnixNano: bigint;
spanId: string | null;
endTimeUnixNano: any; // ❌ Using any
startTimeUnixNano: any; // ❌ Using any
name: ReactNode; // ❌ Should be string
span: OtlpSpan;
startNs: bigint;
endNs: bigint | null;
children: SpanNode[];
events: OtlpSpanEvent[];
};Issues:
The old
onSelectSpan={(spanId: string | null): void => {
throw new Error("Function not implemented.");
}}
onSelectEvent={(spanId: string, eventIndex: number): void => {
throw new Error("Function not implemented.");
}}These throw errors instead of being implemented. This will crash the app if users interact with the timeline view. Potential Bugs
const durationMs = span.endNs
? (span.endNs - span.startNs) / 1_000_000n
: null;Then on line 135:
const durationMs = span.endTimeUnixNano
? (span.endTimeUnixNano - span.startTimeUnixNano) / 1_000_000
: null;This uses
onClick={() => onSelectSpan(span.spanId)}
export function isSpanInProgress(span: SpanNode): boolean {
return span.endNs === undefined;
}This checks for return span.endNs === null;Performance Considerations
Adding
The timeline calculations are properly memoized, but the
No virtualization is implemented for the span list. With hundreds or thousands of spans, rendering performance could degrade. Consider using react-virtual or similar. Security ConcernsNo significant security issues identified. The code properly sanitizes and validates data through TypeScript types (once the Best Practices & Maintainability
Constants like
Complex algorithms like
No error boundaries or error handling for edge cases like:
Test CoverageNo tests are included in this PR. Given the complexity of the timeline calculations, unit tests for:
would significantly improve confidence in the implementation. RecommendationsCritical (must fix):
High priority:
Nice to have:
SummaryThis is a solid implementation of a complex feature with good component architecture and visual polish. However, there are critical type safety issues and unimplemented functionality that need to be addressed before merging. The code shows good understanding of React patterns and performance optimization, but needs refinement in TypeScript usage and completeness. |
63d40ba to
d77a4fc
Compare
2a858f0 to
d559f28
Compare
d559f28 to
dff6754
Compare
d77a4fc to
828baf3
Compare
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/traces
@rivetkit/workflow-engine
@rivetkit/virtual-websocket
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
828baf3 to
a316801
Compare
dff6754 to
e4ac15a
Compare
e4ac15a to
a18121c
Compare
a316801 to
3d621b9
Compare

No description provided.