Skip to content

Commit 0756109

Browse files
committed
chore: add spanId and parentSpanId
resolves #216
1 parent bfeaa78 commit 0756109

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/transformers.ts

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export function transformTransaction(item: any): Transaction {
2929
return {
3030
name: item.transaction,
3131
traceId: item.contexts.trace.trace_id,
32+
spanId: item.contexts.trace.span_id,
33+
status: item.contexts.trace.status,
34+
data: item.contexts.trace?.data ?? {},
35+
op: item.contexts.trace?.op ?? null,
36+
parentSpanId: item.contexts.trace?.parent_span_id ?? null,
3237
release: item.release,
3338
tags: item.tags || {},
3439
extra: item.extra,

src/types.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,20 @@ declare namespace sentryTestkit {
4747
interface Transaction {
4848
name: string
4949
traceId: string
50+
spanId: string
51+
parentSpanId?: string | null
52+
data?: Record<string, any>
53+
status?: string | null
54+
op?: string | null
5055
release?: string
51-
extra?: Record<string, unknown>
52-
tags: Record<string, unknown>
56+
extra?: Record<string, any>
57+
tags: Record<string, any>
5358
spans: Span[]
5459
}
5560

5661
export interface Testkit {
5762
puppeteer: {
58-
startListening(page: Page, baseUrl?: String): void
63+
startListening(page: Page, baseUrl?: string): void
5964
stopListening(page: Page): void
6065
}
6166
reports(): Report[]

0 commit comments

Comments
 (0)