Skip to content

Commit

Permalink
chore: fix test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
heitorlessa committed Nov 30, 2021
1 parent ec939c5 commit b0c0188
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions aws_lambda_powertools/tracing/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,9 @@ def __init__(
if self.auto_patch:
self.patch(modules=patch_modules)

if "aws_xray_sdk" in self.provider.__module__:
if self._is_xray_provider():
self._disable_xray_trace_batching()

def _disable_xray_trace_batching(self):
"""Configure X-Ray SDK to send subsegment individually over batching
Known issue: https://github.com/awslabs/aws-lambda-powertools-python/issues/283
"""
if self.disabled:
logger.debug("Tracing has been disabled, aborting streaming override")
return

aws_xray_sdk.core.xray_recorder.configure(streaming_threshold=0)

def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]):
"""Adds annotation to existing segment or subsegment
Expand Down Expand Up @@ -776,5 +766,15 @@ def _patch_xray_provider(self):

return provider

def _disable_xray_trace_batching(self):
"""Configure X-Ray SDK to send subsegment individually over batching
Known issue: https://github.com/awslabs/aws-lambda-powertools-python/issues/283
"""
if self.disabled:
logger.debug("Tracing has been disabled, aborting streaming override")
return

aws_xray_sdk.core.xray_recorder.configure(streaming_threshold=0)

def _is_xray_provider(self):
return "aws_xray_sdk" in self.provider.__module__

0 comments on commit b0c0188

Please sign in to comment.