Skip to content

Commit 0a61687

Browse files
committed
fix: naming and staticmethod consistency
1 parent 582f023 commit 0a61687

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

aws_lambda_powertools/tracing/tracer.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def __init__(
150150
self.auto_patch = self._config["auto_patch"]
151151

152152
if self.disabled:
153-
self.__disable_tracing_provider()
153+
self._disable_tracer_provider()
154154

155155
if self.auto_patch:
156156
self.patch(modules=patch_modules)
@@ -601,12 +601,14 @@ def _add_full_exception_as_metadata(
601601
"""
602602
subsegment.put_metadata(key=f"{method_name} error", value=error, namespace=self._config["service"])
603603

604-
def __disable_tracing_provider(self):
604+
@staticmethod
605+
def _disable_tracer_provider():
605606
"""Forcefully disables tracing"""
606607
logger.debug("Disabling tracer provider...")
607608
aws_xray_sdk.global_sdk_config.set_sdk_enabled(False)
608609

609-
def __is_trace_disabled(self) -> bool:
610+
@staticmethod
611+
def _is_tracer_disabled() -> bool:
610612
"""Detects whether trace has been disabled
611613
612614
Tracing is automatically disabled in the following conditions:
@@ -643,7 +645,7 @@ def __build_config(
643645
provider: aws_xray_sdk.core.xray_recorder = None,
644646
):
645647
""" Populates Tracer config for new and existing initializations """
646-
is_disabled = disabled if disabled is not None else self.__is_trace_disabled()
648+
is_disabled = disabled if disabled is not None else self._is_tracer_disabled()
647649
is_service = service if service is not None else os.getenv("POWERTOOLS_SERVICE_NAME")
648650

649651
self._config["provider"] = provider if provider is not None else self._config["provider"]

0 commit comments

Comments
 (0)