8000 include transaction's tracestate in corresponding event's debug_meta · Zlash65/sentry-javascript@cfd046f · GitHub
[go: up one dir, main page]

Skip to content

Commit cfd046f

Browse files
committed
include transaction's tracestate in corresponding event's debug_meta
1 parent 003ab3f commit cfd046f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/tracing/src/transaction.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { getCurrentHub, Hub } from '@sentry/hub';
2-
import { Event, Measurements, Transaction as TransactionInterface, TransactionContext } from '@sentry/types';
2+
import { DebugMeta, Event, Measurements, Transaction as TransactionInterface, TransactionContext } from '@sentry/types';
33
import { dropUndefinedKeys, isInstanceOf, logger } from '@sentry/utils';
44

55
import { Span as SpanClass, SpanRecorder } from './span';
66
import { computeTracestateValue } from './utils';
77

8-
interface TransactionMetadata {
9-
transactionSampling?: { [key: string]: string | number };
10-
}
8+
type TransactionMetadata = Pick<DebugMeta, 'transactionSampling' | 'tracestate'>;
119

1210
/** JSDoc */
1311
export class Transaction extends SpanClass implements TransactionInterface {
@@ -120,6 +118,8 @@ export class Transaction extends SpanClass implements TransactionInterface {
120118
}).endTimestamp;
121119
}
122120

121+
this._metadata.tracestate = this.tracestate;
122+
123123
const transaction: Event = {
124124
contexts: {
125125
trace: this.getTraceContext(),

packages/types/src/debugMeta.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
export interface DebugMeta {
55
images?: Array<DebugImage>;
66
transactionSampling?: { rate?: number; method?: string };
7+
8+
/** The Sentry portion of a transaction's tracestate header, used for dynamic sampling */
9+
tracestate?: string;
710
}
811

912
/**

0 commit comments

Comments
 (0)
0