Span constructor
Span(
- String name,
- SpanContext _spanContext,
- SpanId? _parentSpanId,
- List<
SpanProcessor> _processors, - TimeProvider _timeProvider,
- Resource _resource,
- InstrumentationLibrary _instrumentationLibrary, {
- SpanKind? kind,
- List<
Attribute> ? attributes, - List<
SpanLink> ? links, - Context? parentContext,
- SpanLimits? limits,
- Int64? startTime,
Construct a Span.
Implementation
Span(this.name, this._spanContext, this._parentSpanId, this._processors,
this._timeProvider, this._resource, this._instrumentationLibrary,
{api.SpanKind? kind,
List<api.Attribute>? attributes,
List<api.SpanLink>? links,
api.Context? parentContext,
sdk.SpanLimits? limits,
Int64? startTime})
: _links = _applyLinkLimits(links ?? [], limits ?? sdk.SpanLimits()),
_kind = kind ?? api.SpanKind.internal,
_startTime = startTime ?? _timeProvider.now,
_limits = limits ?? sdk.SpanLimits() {
final pContext = parentContext ?? Context.current;
if (attributes != null) {
setAttributes(attributes);
}
for (var i = 0; i < _processors.length; i++) {
_processors[i].onStart(this, pContext);
}
}