diff --git a/sentry_sdk/integrations/aws_lambda.py b/sentry_sdk/integrations/aws_lambda.py index 011c9eea87..237c69dbee 100644 --- a/sentry_sdk/integrations/aws_lambda.py +++ b/sentry_sdk/integrations/aws_lambda.py @@ -39,6 +39,18 @@ MILLIS_TO_SECONDS = 1000.0 +EVENT_TO_ATTRIBUTES = { + "httpMethod": "http.request.method", + "queryStringParameters": "url.query", + "path": "url.path", + # headers +} + +CONTEXT_TO_ATTRIBUTES = { + "function_name": "faas.name", +} + + def _wrap_init_error(init_error): # type: (F) -> F @ensure_integration_enabled(AwsLambdaIntegration, init_error) @@ -151,10 +163,6 @@ def sentry_handler(aws_event, aws_context, *args, **kwargs): name=aws_context.function_name, source=TRANSACTION_SOURCE_COMPONENT, origin=AwsLambdaIntegration.origin, - custom_sampling_context={ - "aws_event": aws_event, - "aws_context": aws_context, - }, attributes=_prepopulate_attributes(aws_event, aws_context), ): try: @@ -460,18 +468,6 @@ def _event_from_error_json(error_json): return event -EVENT_TO_ATTRIBUTES = { - "httpMethod": "http.request.method", - "queryStringParameters": "url.query", - "path": "url.path", - # headers -} - -CONTEXT_TO_ATTRIBUTES = { - "function_name": "faas.name", -} - - def _prepopulate_attributes(aws_event, aws_context): attributes = {}