Skip to content

Commit

Permalink
O11Y-1508: Change Span to use high resolution time instead of DateTim…
Browse files Browse the repository at this point in the history
…e.now()

 - Implement span limits for WebTracerProvider.
  • Loading branch information
Michael Yeager committed Apr 27, 2022
1 parent eb6510e commit e8468da
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/src/sdk/platforms/web/trace/web_tracer_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,36 @@ class WebTracerProvider extends sdk.TracerProviderBase {
final sdk.Sampler _sampler;
final sdk.TimeProvider _timeProvider;
final api.IdGenerator _idGenerator;
final sdk.SpanLimits _spanLimits;

WebTracerProvider(
{List<api.SpanProcessor> processors,
sdk.Resource resource,
sdk.Sampler sampler,
sdk.TimeProvider timeProvider,
api.IdGenerator idGenerator})
api.IdGenerator idGenerator,
sdk.SpanLimits spanLimits})
:
// Default to a no-op TracerProvider.
_processors = processors ?? [],
_resource = resource ?? sdk.Resource([]),
_sampler = sampler ?? sdk.ParentBasedSampler(sdk.AlwaysOnSampler()),
_timeProvider = timeProvider ?? sdk.DateTimeTimeProvider(),
_idGenerator = idGenerator ?? sdk.IdGenerator(),
_spanLimits = spanLimits ?? sdk.SpanLimits(),
super(
processors: processors,
resource: resource,
sampler: sampler,
idGenerator: idGenerator);
idGenerator: idGenerator,
spanLimits: spanLimits);

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

0 comments on commit e8468da

Please sign in to comment.