RecordingSentrySpanV2 class base

A span that records timing and attribute data for performance monitoring.

This span captures start/end timestamps, attributes, and status. When end is called, the span is passed to OnSpanEndCallback for processing.

Use RecordingSentrySpanV2.root to create a root span with a sampling decision, or RecordingSentrySpanV2.child to create a child span that inherits sampling from its parent.

Implemented types
Implementers

Constructors

RecordingSentrySpanV2.child({required RecordingSentrySpanV2 parent, required String name, required OnSpanEndCallback onSpanEnd, required ClockProvider clock, required DscCreatorCallback dscCreator, DateTime? startTimestamp})
Creates a child span that inherits sampling from its parent.
factory
RecordingSentrySpanV2.root({required SentryId traceId, required String name, required OnSpanEndCallback onSpanEnd, required ClockProvider clock, required DscCreatorCallback dscCreator, required SentryTracesSamplingDecision samplingDecision, DateTime? startTimestamp})
Creates a root span with an explicit sampling decision.
factory

Properties

attributes → Map<String, SentryAttribute>
The read-only view of the attributes of this span using Map.unmodifiable.
no setteroverride
endTimestamp → DateTime?
The end timestamp of this span.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
isEnded → bool
Whether this span has ended.
no setteroverride
name ↔ String
The name of this span.
getter/setter pairoverride
parentSpan → RecordingSentrySpanV2?
The parent span of this span.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
samplingDecision → SentryTracesSamplingDecision
The sampling decision for this span's trace.
no setter
segmentSpan → RecordingSentrySpanV2
The local root span of this trace segment.
no setter
spanId → SpanId
The id of this span.
no setteroverride
startTimestamp → DateTime
The start timestamp of this span.
no setteroverride
status ↔ SentrySpanStatusV2
The status of this span.
getter/setter pairoverride
traceId → SentryId
The id of the trace this span belongs to.
no setteroverride

Methods

end({DateTime? endTimestamp}) → void
Ends this span.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAttribute(String key) → void
Removes an attribute on this span with a matching key.
override
resolveDsc() → SentryTraceContextHeader
The segment's Dynamic Sampling Context (DSC) header.
setAttribute(String key, SentryAttribute value) → void
Sets an attribute on this span, replacing any existing attribute with the same key.
override
setAttributes(Map<String, SentryAttribute> attributes) → void
Sets attributes on this span, replacing existing attributes with the same keys.
override
setAttributesIfAbsent(Map<String, SentryAttribute> attributes) → void
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited