Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 8493172

Browse files
author
Mark Stumpf
committed
Remove fields as global dim
1 parent 22fe624 commit 8493172

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

signalfx_lambda/utils.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
from .version import name, version
55

6-
fields = {}
7-
86
def get_fields(context):
7+
fields = {}
98
function_arn = context.invoked_function_arn
109

1110
# Expected format arn:aws:lambda:us-east-1:accountId:function:functionName:$LATEST
1211
splitted = function_arn.split(':')
13-
1412
fields.update({
1513
'aws_function_version': context.function_version,
1614
'aws_function_name': context.function_name,
@@ -35,15 +33,16 @@ def get_fields(context):
3533
fields['event_source_mappings'] = splitted[6]
3634
fields['lambda_arn'] = function_arn
3735

38-
return fields.copy()
36+
return fields
3937

40-
def get_tracing_fields():
38+
def get_tracing_fields(context):
39+
fields = get_fields(context)
4140
if fields.get('aws_request_id') != context.aws_request_id:
4241
fields.update({
4342
'aws_request_id': context.aws_request_id
4443
})
4544

46-
return get_fields()
45+
return fields
4746

4847

4948
def get_metrics_url():

0 commit comments

Comments
 (0)