Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/aws-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ export { awsLambdaIntegration } from './integration/awslambda';

export { getDefaultIntegrations, init } from './init';
// eslint-disable-next-line typescript/no-deprecated
export { tryPatchHandler, wrapHandler } from './sdk';
export { wrapHandler } from './sdk';
export type { WrapperOptions } from './sdk';
31 changes: 1 addition & 30 deletions packages/aws-serverless/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Scope } from '@sentry/core';
import { consoleSandbox, debug } from '@sentry/core';
import { debug } from '@sentry/core';
import { captureException, captureMessage, flush, getCurrentScope, withScope } from '@sentry/node';
import type { Context, Handler, StreamifyHandler } from 'aws-lambda';
import { performance } from 'perf_hooks';
Expand Down Expand Up @@ -32,12 +32,6 @@ export interface WrapperOptions {
* @default false
*/
captureAllSettledReasons: boolean;
// TODO(v11): Remove this option since its no longer used.
/**
* @deprecated This option has no effect and will be removed in a future major version.
* If you want to disable tracing, set `SENTRY_TRACES_SAMPLE_RATE` to `0.0`, otherwise OpenTelemetry will automatically trace the handler.
*/
startTrace: boolean;
}

/** */
Expand All @@ -61,17 +55,6 @@ function getRejectedReasons<T>(results: PromiseSettledResult<T>[]): T[] {
}, []);
}

/**
* TODO(v11): Remove this function
* @deprecated This function is no longer used and will be removed in a future major version.
*/
export function tryPatchHandler(_taskRoot: string, _handlerPath: string): void {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn('The `tryPatchHandler` function is deprecated and will be removed in a future major version.');
});
}

/**
* Tries to invoke context.getRemainingTimeInMillis if not available returns 0
* Some environments use AWS lambda but don't support this function
Expand Down Expand Up @@ -168,24 +151,12 @@ export function wrapHandler<TEvent, TResult>(
): Handler<TEvent, TResult> | StreamifyHandler<TEvent, TResult> {
const START_TIME = performance.now();

// eslint-disable-next-line typescript/no-deprecated
if (typeof wrapOptions.startTrace !== 'undefined') {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
'The `startTrace` option is deprecated and will be removed in a future major version. If you want to disable tracing, set `SENTRY_TRACES_SAMPLE_RATE` to `0.0`.',
);
});
}

const options: WrapperOptions = {
flushTimeout: 2000,
callbackWaitsForEmptyEventLoop: false,
captureTimeoutWarning: true,
timeoutWarningLimit: 500,
captureAllSettledReasons: false,
// oxlint-disable-next-line typescript/no-deprecated -- set only to satisfy the type; see the TODO below
startTrace: true, // TODO(v11): Remove this option. Set to true here to satisfy the type, but has no effect.
...wrapOptions,
};

Expand Down
Loading