File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
packages/aws-serverless/src
integration/instrumentation-aws-lambda Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -148,5 +148,6 @@ export { awsIntegration } from './integration/aws';
148148export { awsLambdaIntegration } from './integration/awslambda' ;
149149
150150export { getDefaultIntegrations , init } from './init' ;
151- export { wrapHandler } from './sdk' ;
151+ // eslint-disable-next-line deprecation/deprecation
152+ export { tryPatchHandler , wrapHandler } from './sdk' ;
152153export type { WrapperOptions } from './sdk' ;
Original file line number Diff line number Diff line change @@ -57,9 +57,11 @@ import type { LambdaModule } from './internal-types';
5757import { ATTR_FAAS_COLDSTART } from './semconv' ;
5858import type { AwsLambdaInstrumentationConfig , EventContextExtractor } from './types' ;
5959import { wrapHandler } from '../../sdk' ;
60+ import { SDK_VERSION } from '@sentry/core' ;
6061
61- const PACKAGE_VERSION = '0.54.0' ;
62- const PACKAGE_NAME = '@opentelemetry/instrumentation-aws-lambda' ;
62+ // OpenTelemetry package version was 0.54.0 at time of vendoring.
63+ const PACKAGE_VERSION = SDK_VERSION ;
64+ const PACKAGE_NAME = '@sentry/instrumentation-aws-lambda' ;
6365
6466const headerGetter : TextMapGetter < APIGatewayProxyEventHeaders > = {
6567 keys ( carrier ) : string [ ] {
Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ function getRejectedReasons<T>(results: PromiseSettledResult<T>[]): T[] {
5959 } , [ ] ) ;
6060}
6161
62+ /**
63+ * TODO(v11): Remove this function
64+ * @deprecated This function is no longer used and will be removed in a future major version.
65+ */
66+ export function tryPatchHandler ( _taskRoot : string , _handlerPath : string ) : void {
67+ consoleSandbox ( ( ) => {
68+ // eslint-disable-next-line no-console
69+ console . warn ( 'The `tryPatchHandler` function is deprecated and will be removed in a future major version.' ) ;
70+ } ) ;
71+ }
72+
6273/**
6374 * Tries to invoke context.getRemainingTimeInMillis if not available returns 0
6475 * Some environments use AWS lambda but don't support this function
@@ -200,6 +211,8 @@ export function wrapHandler<TEvent, TResult>(
200211 } ) ;
201212 }
202213 } catch ( e ) {
214+ // Errors should already captured in the instrumentation's `responseHook`,
215+ // we capture them here just to be safe. Double captures are deduplicated by the SDK.
203216 captureException ( e , scope => markEventUnhandled ( scope , 'auto.function.aws-serverless.handler' ) ) ;
204217 throw e ;
205218 } finally {
You can’t perform that action at this time.
0 commit comments