Closed slashmo closed 1 year ago
Agreed, on it :+1:
in addEvent no, because the Event creation will have it:
func addEvent(_ event: SpanEvent)
public init<Instant: TracerInstant>(name: String,
at instant: @autoclosure () -> Instant,
attributes: SpanAttributes = [:])
{
record error is a good call tho, added:
func recordError<Instant: TracerInstant>(_ error: Error,
attributes: SpanAttributes,
at instant: @autoclosure () -> Instant)
public func recordError(_ error: Error, attributes: SpanAttributes) {
self.recordError(error, attributes: attributes, at: DefaultTracerClock.now)
}
addEvent
and its relatedrecordError
method should take aclock
argument, defaulting toDefaultTracerClock()
. This would allow us to mock the clock similarly to how we can already do it when callingSpan.end()
.