Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/many-coats-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@spotlightjs/spotlight': patch
'@spotlightjs/electron': patch
'@spotlightjs/overlay': patch
'@spotlightjs/astro': patch
---

Fix span details showing incorrect span start time
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
totalDuration: number;
}) {
const [spanNodeWidth, setSpanNodeWidth] = useState<number>(50);
const spanRelativeStart = span.start_timestamp - startTimestamp;

Check warning on line 89 in packages/overlay/src/integrations/sentry/components/explore/traces/spans/SpanDetails.tsx

View check run for this annotation

Codecov / codecov/patch

packages/overlay/src/integrations/sentry/components/explore/traces/spans/SpanDetails.tsx#L89

Added line #L89 was not covered by tests

const spanDuration = span.timestamp - span.start_timestamp;

Expand Down Expand Up @@ -115,15 +116,15 @@
<DateTime date={span.start_timestamp} />
<span>&mdash;</span>
<span>
<strong>{getFormattedDuration(spanDuration)}</strong> into trace
<strong>{getFormattedDuration(spanRelativeStart)}</strong> into trace

Check warning on line 119 in packages/overlay/src/integrations/sentry/components/explore/traces/spans/SpanDetails.tsx

View check run for this annotation

Codecov / codecov/patch

packages/overlay/src/integrations/sentry/components/explore/traces/spans/SpanDetails.tsx#L119

Added line #L119 was not covered by tests
</span>
</div>
<div className="flex-1">
<div className="border-primary-800 relative h-8 border py-1">
<div
className="bg-primary-800 absolute bottom-0 top-0 -m-0.5 flex w-full items-center p-0.5"
style={{
left: `min(${(spanDuration / totalDuration) * 100}%, 100% - 1px)`,
left: `min(${(spanRelativeStart / totalDuration) * 100}%, 100% - 1px)`,

Check warning on line 127 in packages/overlay/src/integrations/sentry/components/explore/traces/spans/SpanDetails.tsx

View check run for this annotation

Codecov / codecov/patch

packages/overlay/src/integrations/sentry/components/explore/traces/spans/SpanDetails.tsx#L127

Added line #L127 was not covered by tests
width: `max(1px, ${(spanDuration / totalDuration) * 100}%)`,
}}
>
Expand Down