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';
148
148
export { awsLambdaIntegration } from './integration/awslambda' ;
149
149
150
150
export { getDefaultIntegrations , init } from './init' ;
151
- export { wrapHandler } from './sdk' ;
151
+ // eslint-disable-next-line deprecation/deprecation
152
+ export { tryPatchHandler , wrapHandler } from './sdk' ;
152
153
export type { WrapperOptions } from './sdk' ;
Original file line number Diff line number Diff line change @@ -57,9 +57,11 @@ import type { LambdaModule } from './internal-types';
57
57
import { ATTR_FAAS_COLDSTART } from './semconv' ;
58
58
import type { AwsLambdaInstrumentationConfig , EventContextExtractor } from './types' ;
59
59
import { wrapHandler } from '../../sdk' ;
60
+ import { SDK_VERSION } from '@sentry/core' ;
60
61
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' ;
63
65
64
66
const headerGetter : TextMapGetter < APIGatewayProxyEventHeaders > = {
65
67
keys ( carrier ) : string [ ] {
Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ function getRejectedReasons<T>(results: PromiseSettledResult<T>[]): T[] {
59
59
} , [ ] ) ;
60
60
}
61
61
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
+
62
73
/**
63
74
* Tries to invoke context.getRemainingTimeInMillis if not available returns 0
64
75
* Some environments use AWS lambda but don't support this function
@@ -200,6 +211,8 @@ export function wrapHandler<TEvent, TResult>(
200
211
} ) ;
201
212
}
202
213
} 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.
203
216
captureException ( e , scope => markEventUnhandled ( scope , 'auto.function.aws-serverless.handler' ) ) ;
204
217
throw e ;
205
218
} finally {
You can’t perform that action at this time.
0 commit comments