Skip to content

Commit c5939d2

Browse files
committed
test transaction data in trace contexrt
1 parent 62700cd commit c5939d2

File tree

2 files changed

+9
-6
lines changed
  • dev-packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutCallback
  • packages/core/src/tracing

2 files changed

+9
-6
lines changed

dev-packages/node-integration-tests/suites/tracing-new/auto-instrument/mysql/withoutCallback/test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ test('should auto-instrument `mysql` package when using query without callback',
77
expect(envelope).toHaveLength(3);
88

99
assertSentryTransaction(envelope[2], {
10-
transaction: 'Test Transaction',
11-
extra: {
12-
result_done: 'yes',
13-
result_done2: 'yes',
10+
contexts: {
11+
trace: {
12+
data: {
13+
result_done: 'yes',
14+
result_done2: 'yes',
15+
},
16+
},
1417
},
18+
transaction: 'Test Transaction',
1519
spans: [
1620
{
1721
description: 'SELECT 1 + 1 AS solution',

packages/core/src/tracing/transaction.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { dropUndefinedKeys, logger, timestampInSeconds } from '@sentry/utils';
1414
import { DEBUG_BUILD } from '../debug-build';
1515
import type { Hub } from '../hub';
1616
import { getCurrentHub } from '../hub';
17-
import { spanGetAttributes, spanToTraceContext } from '../utils/spanUtils';
17+
import { spanToTraceContext } from '../utils/spanUtils';
1818
import { getDynamicSamplingContextFromClient } from './dynamicSamplingContext';
1919
import { Span as SpanClass, SpanRecorder } from './span';
2020
import { ensureTimestampInSeconds } from './utils';
@@ -291,7 +291,6 @@ export class Transaction extends SpanClass implements TransactionInterface {
291291
start_timestamp: this.startTimestamp,
292292
// eslint-disable-next-line deprecation/deprecation
293293
tags: this.tags,
294-
extra: spanGetAttributes(this),
295294
timestamp: this.endTimestamp,
296295
transaction: this.name,
297296
type: 'transaction',

0 commit comments

Comments
 (0)