File tree Expand file tree Collapse file tree
src/opentelemetry/sdk/trace Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 TracerProvider ,
2222 _default_tracer_configurator ,
2323 _RuleBasedTracerConfigurator ,
24- _tracer_name_matches_glob ,
24+ _scope_name_matches_glob ,
2525 _TracerConfig ,
2626 sampling ,
2727)
@@ -73,7 +73,7 @@ def tracer_configurator(tracer_scope):
7373 return _RuleBasedTracerConfigurator (
7474 rules = [
7575 (
76- _tracer_name_matches_glob (glob_pattern = str (i )),
76+ _scope_name_matches_glob (glob_pattern = str (i )),
7777 _TracerConfig (is_enabled = True ),
7878 )
7979 for i in range (num_tracer_configurator_rules )
Original file line number Diff line number Diff line change @@ -1240,17 +1240,18 @@ def start_span( # pylint: disable=too-many-locals
12401240
12411241
12421242_TracerConfiguratorT = Callable [[InstrumentationScope ], _TracerConfig ]
1243- _TracerConfiguratorRulesPredicateT = Callable [[InstrumentationScope ], bool ]
1243+ _InstrumentationScopePredicateT = Callable [[InstrumentationScope ], bool ]
12441244_TracerConfiguratorRulesT = Sequence [
1245- tuple [_TracerConfiguratorRulesPredicateT , _TracerConfig ]
1245+ tuple [_InstrumentationScopePredicateT , _TracerConfig ]
12461246]
12471247
12481248
1249- def _tracer_name_matches_glob (
1249+ # TODO: share this with configurators for other signals
1250+ def _scope_name_matches_glob (
12501251 glob_pattern : str ,
1251- ) -> _TracerConfiguratorRulesPredicateT :
1252- def inner (tracer_scope : InstrumentationScope ) -> bool :
1253- return fnmatch .fnmatch (tracer_scope .name , glob_pattern )
1252+ ) -> _InstrumentationScopePredicateT :
1253+ def inner (scope : InstrumentationScope ) -> bool :
1254+ return fnmatch .fnmatch (scope .name , glob_pattern )
12541255
12551256 return inner
12561257
Original file line number Diff line number Diff line change 4747 Resource ,
4848 TracerProvider ,
4949 _RuleBasedTracerConfigurator ,
50- _tracer_name_matches_glob ,
50+ _scope_name_matches_glob ,
5151 _TracerConfig ,
5252)
5353from opentelemetry .sdk .trace .id_generator import RandomIdGenerator
@@ -2236,11 +2236,11 @@ def test_rule_based_tracer_configurator(self):
22362236 # pylint: disable=protected-access
22372237 rules = [
22382238 (
2239- _tracer_name_matches_glob (glob_pattern = "module_name" ),
2239+ _scope_name_matches_glob (glob_pattern = "module_name" ),
22402240 _TracerConfig (is_enabled = True ),
22412241 ),
22422242 (
2243- _tracer_name_matches_glob (glob_pattern = "other_module_name" ),
2243+ _scope_name_matches_glob (glob_pattern = "other_module_name" ),
22442244 _TracerConfig (is_enabled = False ),
22452245 ),
22462246 ]
@@ -2282,7 +2282,7 @@ def test_rule_based_tracer_configurator_default_when_rules_dont_match(
22822282 # pylint: disable=protected-access
22832283 rules = [
22842284 (
2285- _tracer_name_matches_glob (glob_pattern = "module_name" ),
2285+ _scope_name_matches_glob (glob_pattern = "module_name" ),
22862286 _TracerConfig (is_enabled = False ),
22872287 ),
22882288 ]
You can’t perform that action at this time.
0 commit comments