@@ -287,6 +287,10 @@ def value(self, key: str) -> None:
287287 return None
288288
289289
290+ def _strip_leading_slash (path : str ) -> str :
291+ return path .lstrip (" /" ).strip ()
292+
293+
290294def convert_to_bool (value : Any ) -> bool :
291295 if isinstance (value , bool ):
292296 return value
@@ -339,14 +343,22 @@ def convert_to_list(value: Any) -> List[Any]:
339343 return []
340344
341345
346+ def convert_ignore_paths (value : Any ) -> List [str ]:
347+ """
348+ Removes leading slashes from paths and returns a list of strings.
349+ """
350+ raw_paths = convert_to_list (value )
351+ return [_strip_leading_slash (path ) for path in raw_paths ]
352+
353+
342354def convert_endpoint_sampling (value : Union [str , Dict [str , Any ]]) -> Dict [str , int ]:
343355 """
344356 Converts endpoint sampling configuration from string or dict format
345357 to a normalized dict.
346358 Example: '/endpoint:40,/test:0' -> {'/endpoint': 40, '/test': 0}
347359 """
348360 if isinstance (value , dict ):
349- return {k : int (v ) for k , v in value .items ()}
361+ return {_strip_leading_slash ( k ) : int (v ) for k , v in value .items ()}
350362 if isinstance (value , str ):
351363 if not value .strip ():
352364 return {}
@@ -362,7 +374,7 @@ def convert_endpoint_sampling(value: Union[str, Dict[str, Any]]) -> Dict[str, in
362374 "Must be between 0 and 100."
363375 )
364376 continue
365- result [endpoint . strip ( )] = rate_int
377+ result [_strip_leading_slash ( endpoint )] = rate_int
366378 except ValueError :
367379 logger .warning (f"Invalid sampling configuration: { pair } " )
368380 continue
@@ -375,9 +387,9 @@ def convert_endpoint_sampling(value: Union[str, Dict[str, Any]]) -> Dict[str, in
375387 "core_agent_download" : convert_to_bool ,
376388 "core_agent_launch" : convert_to_bool ,
377389 "disabled_instruments" : convert_to_list ,
378- "ignore" : convert_to_list ,
379- "ignore_endpoints" : convert_to_list ,
380- "ignore_jobs" : convert_to_list ,
390+ "ignore" : convert_ignore_paths ,
391+ "ignore_endpoints" : convert_ignore_paths ,
392+ "ignore_jobs" : convert_ignore_paths ,
381393 "monitor" : convert_to_bool ,
382394 "sample_rate" : convert_sample_rate ,
383395 "sample_endpoints" : convert_endpoint_sampling ,
0 commit comments