diff --git a/aws_lambda/aws_lambda.py b/aws_lambda/aws_lambda.py index 17c0126..9e765d9 100755 --- a/aws_lambda/aws_lambda.py +++ b/aws_lambda/aws_lambda.py @@ -539,6 +539,9 @@ def create_function(cfg, path_to_zip_file, use_s3=False, s3_file=None): 'SecurityGroupIds': cfg.get('security_group_ids', []), }, 'Publish': True, + 'TracingConfig': { + 'Mode': cfg.get('aws_xray_tracing_config', 'PassThrough') + }, } else: kwargs = { @@ -555,6 +558,9 @@ def create_function(cfg, path_to_zip_file, use_s3=False, s3_file=None): 'SecurityGroupIds': cfg.get('security_group_ids', []), }, 'Publish': True, + 'TracingConfig': { + 'Mode': cfg.get('aws_xray_tracing_config', 'PassThrough') + }, } if 'tags' in cfg: @@ -636,6 +642,9 @@ def update_function( 'SubnetIds': cfg.get('subnet_ids', []), 'SecurityGroupIds': cfg.get('security_group_ids', []), }, + 'TracingConfig': { + 'Mode': cfg.get('aws_xray_tracing_config', 'PassThrough') + }, } if 'environment_variables' in cfg: diff --git a/aws_lambda/project_templates/config.yaml b/aws_lambda/project_templates/config.yaml index 8029c80..41c12af 100644 --- a/aws_lambda/project_templates/config.yaml +++ b/aws_lambda/project_templates/config.yaml @@ -16,6 +16,9 @@ runtime: python2.7 aws_access_key_id: aws_secret_access_key: +# set xray tracing config to either PassThrough or Active +aws_xray_tracing_config: PassThrough + # dist_directory: dist # timeout: 15 # memory_size: 512