getTracer method

  1. @override
Tracer getTracer(
  1. String name, {
  2. String? version = '',
})
override

Returns a Tracer, creating one if one with the given name and version is not already created.

name should be the name of the tracer or instrumentation library. version should be the version of the tracer or instrumentation library.

Implementation

@override
api.Tracer getTracer(String name, {String? version = ''}) {
  final key = '$name@$version';
  return _tracers.putIfAbsent(
      key,
      () => Tracer(
          _processors,
          _resource,
          _sampler,
          sdk.DateTimeTimeProvider(),
          _idGenerator,
          sdk.InstrumentationLibrary(name, version),
          spanLimits: _spanLimits));
}