Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana committed Nov 22, 2024
1 parent faa5654 commit 559e4b4
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions sentry_sdk/integrations/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 = {}

Expand Down

0 comments on commit 559e4b4

Please sign in to comment.