Skip to content

Commit 2b7400a

Browse files
committed
fix build
1 parent c2f6dc2 commit 2b7400a

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

packages/spotlight/src/ui/telemetry/store/utils/profileProcessor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { graftProfileSpans } from "../../data/profiles";
22
import type {
33
ProfileSample,
4-
SentryProfileEvent,
4+
SentryProfileV1Event,
55
SentryProfileTransactionInfo,
66
Trace,
77
} from "../../types";
@@ -24,7 +24,7 @@ export interface ProfileProcessingResult {
2424
* Handles profile grafting onto existing traces if available.
2525
*/
2626
export function processProfileEvent(
27-
event: SentryProfileEvent,
27+
event: SentryProfileV1Event,
2828
context: ProfileProcessingContext,
2929
): ProfileProcessingResult {
3030
const { tracesById } = context;
@@ -65,7 +65,7 @@ export function processProfileEvent(
6565
),
6666
})),
6767
frames: event.profile.frames,
68-
stacks: event.profile.stacks.map((s) => Array.from(s).reverse()),
68+
stacks: event.profile.stacks.map((s: number[]) => Array.from(s).reverse()),
6969
timestamp,
7070
active_thread_id: profileTxn.active_thread_id,
7171
};

packages/spotlight/src/ui/telemetry/store/utils/traceInitializer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import type { SentryEvent, SentryTransactionEvent, Span, Trace } from "../../typ
66
*/
77
export function initializeTrace(event: SentryEvent): Trace {
88
const traceCtx = event.contexts!.trace;
9+
10+
// Add guard to ensure trace context and trace_id exist
11+
if (!traceCtx || !traceCtx.trace_id) {
12+
throw new Error('Event missing required trace context or trace_id');
13+
}
914

1015
return {
1116
...traceCtx,

packages/spotlight/src/ui/telemetry/store/utils/traceProcessor.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { graftProfileSpans } from "../../data/profiles";
2-
import type { SentryEvent, SentryTransactionEvent, Span, Trace } from "../../types";
2+
import type { SentryTransactionEvent, Span, Trace } from "../../types";
33
import { compareSpans, groupSpans } from "../../utils/traces";
44
import type { SentryProfileWithTraceMeta } from "../types";
55
import { toTimestamp } from "../utils";
@@ -25,6 +25,10 @@ export function processTransactionEvent(
2525
const traceCtx = event.contexts.trace;
2626
const { existingTrace, profilesByTraceId } = context;
2727

28+
// Add guard to ensure trace_id exists
29+
throw new Error("Transaction event missing required trace_id");
30+
}
31+
2832
// Initialize or get existing trace
2933
const trace: Trace = existingTrace ?? {
3034
...traceCtx,

0 commit comments

Comments
 (0)