@@ -150,7 +150,7 @@ def __init__(
150
150
self .auto_patch = self ._config ["auto_patch" ]
151
151
152
152
if self .disabled :
153
- self .__disable_tracing_provider ()
153
+ self ._disable_tracer_provider ()
154
154
155
155
if self .auto_patch :
156
156
self .patch (modules = patch_modules )
@@ -601,12 +601,14 @@ def _add_full_exception_as_metadata(
601
601
"""
602
602
subsegment .put_metadata (key = f"{ method_name } error" , value = error , namespace = self ._config ["service" ])
603
603
604
- def __disable_tracing_provider (self ):
604
+ @staticmethod
605
+ def _disable_tracer_provider ():
605
606
"""Forcefully disables tracing"""
606
607
logger .debug ("Disabling tracer provider..." )
607
608
aws_xray_sdk .global_sdk_config .set_sdk_enabled (False )
608
609
609
- def __is_trace_disabled (self ) -> bool :
610
+ @staticmethod
611
+ def _is_tracer_disabled () -> bool :
610
612
"""Detects whether trace has been disabled
611
613
612
614
Tracing is automatically disabled in the following conditions:
@@ -643,7 +645,7 @@ def __build_config(
643
645
provider : aws_xray_sdk .core .xray_recorder = None ,
644
646
):
645
647
""" 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 ()
647
649
is_service = service if service is not None else os .getenv ("POWERTOOLS_SERVICE_NAME" )
648
650
649
651
self ._config ["provider" ] = provider if provider is not None else self ._config ["provider" ]
0 commit comments