22
33import itertools
44import os
5- from typing import Any , Dict , List , Sequence , Tuple , Union
5+ from typing import Any , Dict , List , Sequence , Tuple , Union , Optional
66
77from instana .configurator import config
88from instana .log import logger
@@ -172,9 +172,7 @@ def parse_ignored_endpoints_from_yaml(file_path: str) -> List[str]:
172172 if "tracing" in config_reader .data :
173173 ignore_endpoints_dict = config_reader .data ["tracing" ].get ("ignore-endpoints" )
174174 elif "com.instana.tracing" in config_reader .data :
175- logger .warning (
176- 'Please use "tracing" instead of "com.instana.tracing" for local configuration file.'
177- )
175+ logger .warning (DEPRECATED_CONFIG_KEY_WARNING )
178176 ignore_endpoints_dict = config_reader .data ["com.instana.tracing" ].get (
179177 "ignore-endpoints"
180178 )
@@ -300,7 +298,7 @@ def get_disable_trace_configurations_from_env() -> Tuple[List[str], List[str]]:
300298 return [], []
301299
302300
303- def get_tracing_root_key (config_data : Dict [str , Any ]) -> Union [str , None ]:
301+ def get_tracing_root_key (config_data : Dict [str , Any ]) -> Optional [str ]:
304302 """
305303 Get the root key for tracing configuration from config data.
306304 Handles both 'tracing' and deprecated 'com.instana.tracing' keys.
@@ -326,8 +324,9 @@ def get_disable_trace_configurations_from_yaml() -> Tuple[List[str], List[str]]:
326324 if not root_key :
327325 return [], []
328326
329- tracing_disable_config = config_reader .data [root_key ].get ("disable" , "" )
330- return parse_span_disabling (tracing_disable_config )
327+ if tracing_disable_config := config_reader .data [root_key ].get ("disable" , None ):
328+ return parse_span_disabling (tracing_disable_config )
329+ return [], []
331330
332331
333332def get_disable_trace_configurations_from_local () -> Tuple [List [str ], List [str ]]:
@@ -337,7 +336,7 @@ def get_disable_trace_configurations_from_local() -> Tuple[List[str], List[str]]
337336 return [], []
338337
339338
340- def validate_stack_trace_level (level_value : Any , context : str = "" ) -> Union [str , None ]:
339+ def validate_stack_trace_level (level_value : Any , context : str = "" ) -> Optional [str ]:
341340 """
342341 Validate stack trace level value.
343342
@@ -359,7 +358,7 @@ def validate_stack_trace_level(level_value: Any, context: str = "") -> Union[str
359358 return None
360359
361360
362- def validate_stack_trace_length (length_value : Any , context : str = "" ) -> Union [int , None ]:
361+ def validate_stack_trace_length (length_value : Any , context : str = "" ) -> Optional [int ]:
363362 """
364363 Validate stack trace length value.
365364
0 commit comments