Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Commit a45b62a

Browse files
Introducing aws_xray_tracing_config in config.yaml in order to set tracing active when deploying the function to AWS. By default or if nothing specified the configuration will remain PassThrough which is the default setting and which does not create any extra costs. However setting this to Active will cost (at least eventually).
1 parent 7afe7cf commit a45b62a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

aws_lambda/aws_lambda.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ def create_function(cfg, path_to_zip_file, use_s3=False, s3_file=None):
539539
'SecurityGroupIds': cfg.get('security_group_ids', []),
540540
},
541541
'Publish': True,
542+
'TracingConfig': {
543+
'Mode': cfg.get('aws_xray_tracing_config', 'PassThrough')
544+
},
542545
}
543546
else:
544547
kwargs = {
@@ -555,6 +558,9 @@ def create_function(cfg, path_to_zip_file, use_s3=False, s3_file=None):
555558
'SecurityGroupIds': cfg.get('security_group_ids', []),
556559
},
557560
'Publish': True,
561+
'TracingConfig': {
562+
'Mode': cfg.get('aws_xray_tracing_config', 'PassThrough')
563+
},
558564
}
559565

560566
if 'tags' in cfg:
@@ -636,6 +642,9 @@ def update_function(
636642
'SubnetIds': cfg.get('subnet_ids', []),
637643
'SecurityGroupIds': cfg.get('security_group_ids', []),
638644
},
645+
'TracingConfig': {
646+
'Mode': cfg.get('aws_xray_tracing_config', 'PassThrough')
647+
},
639648
}
640649

641650
if 'environment_variables' in cfg:

aws_lambda/project_templates/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ runtime: python2.7
1616
aws_access_key_id:
1717
aws_secret_access_key:
1818

19+
# set xray tracing config to either PassThrough or Active
20+
aws_xray_tracing_config: PassThrough
21+
1922
# dist_directory: dist
2023
# timeout: 15
2124
# memory_size: 512

0 commit comments

Comments
 (0)