Skip to content

Commit ad72d86

Browse files
committed
fix: rename startTransaction -> startTrace
1 parent 8dd15ac commit ad72d86

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/serverless/src/awslambda.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface WrapperOptions {
5252
* You may want to disable this if you use express within Lambda (use tracingHandler instead).
5353
* @default true
5454
*/
55-
startTransaction: boolean;
55+
startTrace: boolean;
5656
}
5757

5858
export const defaultIntegrations: Integration[] = [...Sentry.defaultIntegrations, new AWSServices({ optional: true })];
@@ -235,7 +235,7 @@ export function wrapHandler<TEvent, TResult>(
235235
captureTimeoutWarning: true,
236236
timeoutWarningLimit: 500,
237237
captureAllSettledReasons: false,
238-
startTransaction: true,
238+
startTrace: true,
239239
...wrapOptions,
240240
};
241241
let timeoutWarningTimer: NodeJS.Timeout;
@@ -294,7 +294,7 @@ export function wrapHandler<TEvent, TResult>(
294294
const hub = getCurrentHub();
295295

296296
let transaction: Sentry.Transaction | undefined;
297-
if (options.startTransaction) {
297+
if (options.startTrace) {
298298
const eventWithHeaders = event as { headers?: { [key: string]: string } };
299299

300300
const sentryTrace =
@@ -324,7 +324,7 @@ export function wrapHandler<TEvent, TResult>(
324324
let rv: TResult;
325325
try {
326326
enhanceScopeWithEnvironmentData(scope, context, START_TIME);
327-
if (options.startTransaction) {
327+
if (options.startTrace) {
328328
enhanceScopeWithTransactionData(scope, context);
329329
// We put the transaction on the scope so users can attach children to it
330330
scope.setSpan(transaction);

packages/serverless/test/awslambda.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ describe('AWSLambda', () => {
183183
expect(SentryNode.captureException).toBeCalledTimes(2);
184184
});
185185

186-
// "wrapHandler() ... successful execution" tests the default of startTransaction enabled
187-
test('startTransaction disabled', async () => {
186+
// "wrapHandler() ... successful execution" tests the default of startTrace enabled
187+
test('startTrace disabled', async () => {
188188
expect.assertions(3);
189189

190190
const handler: Handler = async (_event, _context) => 42;
191-
const wrappedHandler = wrapHandler(handler, { startTransaction: false });
191+
const wrappedHandler = wrapHandler(handler, { startTrace: false });
192192
await wrappedHandler(fakeEvent, fakeContext, fakeCallback);
193193

194194
// @ts-expect-error see "Why @ts-expect-error" note

0 commit comments

Comments
 (0)