@@ -189,6 +189,7 @@ def get_tracer(
189189 instrumenting_module_name : str ,
190190 instrumenting_library_version : typing .Optional [str ] = None ,
191191 schema_url : typing .Optional [str ] = None ,
192+ attributes : typing .Optional [types .Attributes ] = None ,
192193 ) -> "Tracer" :
193194 """Returns a `Tracer` for use by the given instrumentation library.
194195
@@ -216,6 +217,7 @@ def get_tracer(
216217 ``importlib.metadata.version(instrumenting_library_name)``.
217218
218219 schema_url: Optional. Specifies the Schema URL of the emitted telemetry.
220+ attributes: Optional. Specifies the attributes of the emitted telemetry.
219221 """
220222
221223
@@ -230,6 +232,7 @@ def get_tracer(
230232 instrumenting_module_name : str ,
231233 instrumenting_library_version : typing .Optional [str ] = None ,
232234 schema_url : typing .Optional [str ] = None ,
235+ attributes : typing .Optional [types .Attributes ] = None ,
233236 ) -> "Tracer" :
234237 # pylint:disable=no-self-use,unused-argument
235238 return NoOpTracer ()
@@ -249,17 +252,20 @@ def get_tracer(
249252 instrumenting_module_name : str ,
250253 instrumenting_library_version : typing .Optional [str ] = None ,
251254 schema_url : typing .Optional [str ] = None ,
255+ attributes : typing .Optional [types .Attributes ] = None ,
252256 ) -> "Tracer" :
253257 if _TRACER_PROVIDER :
254258 return _TRACER_PROVIDER .get_tracer (
255259 instrumenting_module_name ,
256260 instrumenting_library_version ,
257261 schema_url ,
262+ attributes ,
258263 )
259264 return ProxyTracer (
260265 instrumenting_module_name ,
261266 instrumenting_library_version ,
262267 schema_url ,
268+ attributes ,
263269 )
264270
265271
@@ -407,10 +413,12 @@ def __init__(
407413 instrumenting_module_name : str ,
408414 instrumenting_library_version : typing .Optional [str ] = None ,
409415 schema_url : typing .Optional [str ] = None ,
416+ attributes : typing .Optional [types .Attributes ] = None ,
410417 ):
411418 self ._instrumenting_module_name = instrumenting_module_name
412419 self ._instrumenting_library_version = instrumenting_library_version
413420 self ._schema_url = schema_url
421+ self ._attributes = attributes
414422 self ._real_tracer : Optional [Tracer ] = None
415423 self ._noop_tracer = NoOpTracer ()
416424
@@ -424,6 +432,7 @@ def _tracer(self) -> Tracer:
424432 self ._instrumenting_module_name ,
425433 self ._instrumenting_library_version ,
426434 self ._schema_url ,
435+ self ._attributes ,
427436 )
428437 return self ._real_tracer
429438 return self ._noop_tracer
@@ -492,6 +501,7 @@ def get_tracer(
492501 instrumenting_library_version : typing .Optional [str ] = None ,
493502 tracer_provider : Optional [TracerProvider ] = None ,
494503 schema_url : typing .Optional [str ] = None ,
504+ attributes : typing .Optional [types .Attributes ] = None ,
495505) -> "Tracer" :
496506 """Returns a `Tracer` for use by the given instrumentation library.
497507
@@ -503,7 +513,10 @@ def get_tracer(
503513 if tracer_provider is None :
504514 tracer_provider = get_tracer_provider ()
505515 return tracer_provider .get_tracer (
506- instrumenting_module_name , instrumenting_library_version , schema_url
516+ instrumenting_module_name ,
517+ instrumenting_library_version ,
518+ schema_url ,
519+ attributes ,
507520 )
508521
509522
0 commit comments