@@ -34,16 +34,16 @@ import Dispatch
3434///
3535/// - Parameters:
3636/// - operationName: The name of the operation being traced. This may be a handler function, database call, ...
37- /// - clock: The clock to use as time source for the start time of the ``Span``
37+ /// - instant: the time instant at which the span started
3838/// - baggage: The `Baggage` providing information on where to start the new ``Span``.
3939/// - kind: The ``SpanKind`` of the new ``Span``.
4040/// - function: The function name in which the span was started
4141/// - fileID: The `fileID` where the span was started.
4242/// - line: The file line where the span was started.
4343@available ( macOS 10 . 15 , iOS 13 , tvOS 13 , watchOS 6 , * ) // for TaskLocal Baggage
44- public func startSpan< Clock : TracerClock > (
44+ public func startSpan< Instant : TracerInstant > (
4545 _ operationName: String ,
46- clock : Clock ,
46+ at instant : @autoclosure ( ) -> Instant ,
4747 baggage: @autoclosure ( ) -> Baggage = . current ?? . topLevel,
4848 ofKind kind: SpanKind = . internal,
4949 function: String = #function,
@@ -54,7 +54,7 @@ public func startSpan<Clock: TracerClock>(
5454 // we try to not use the deprecated methods ourselves anyway
5555 InstrumentationSystem . legacyTracer. startAnySpan (
5656 operationName,
57- clock : clock ,
57+ at : instant ( ) ,
5858 baggage: baggage ( ) ,
5959 ofKind: kind,
6060 function: function,
@@ -99,7 +99,7 @@ public func startSpan(
9999 // we try to not use the deprecated methods ourselves anyway
100100 InstrumentationSystem . legacyTracer. startAnySpan (
101101 operationName,
102- clock : DefaultTracerClock ( ) ,
102+ at : DefaultTracerClock . now ,
103103 baggage: baggage ( ) ,
104104 ofKind: kind,
105105 function: function,
@@ -129,7 +129,7 @@ public func startSpan(
129129/// - operationName: The name of the operation being traced. This may be a handler function, database call, ...
130130/// - baggage: The `Baggage` providing information on where to start the new ``Span``.
131131/// - kind: The ``SpanKind`` of the new ``Span``.
132- /// - clock: The clock to use as time source for the start time of the ``Span``
132+ /// - instant: the time instant at which the span started
133133/// - function: The function name in which the span was started
134134/// - fileID: The `fileID` where the span was started.
135135/// - line: The file line where the span was started.
@@ -138,7 +138,7 @@ public func startSpan(
138138 _ operationName: String ,
139139 baggage: @autoclosure ( ) -> Baggage = . current ?? . topLevel,
140140 ofKind kind: SpanKind = . internal,
141- clock : some TracerClock = DefaultTracerClock ( ) ,
141+ at instant : @autoclosure ( ) -> some TracerInstant = DefaultTracerClock . now ,
142142 function: String = #function,
143143 file fileID: String = #fileID,
144144 line: UInt = #line
@@ -147,7 +147,7 @@ public func startSpan(
147147 // we try to not use the deprecated methods ourselves anyway
148148 InstrumentationSystem . tracer. startAnySpan (
149149 operationName,
150- clock : clock ,
150+ at : instant ( ) ,
151151 baggage: baggage ( ) ,
152152 ofKind: kind,
153153 function: function,
@@ -173,7 +173,7 @@ public func startSpan(
173173///
174174/// - Parameters:
175175/// - operationName: The name of the operation being traced. This may be a handler function, database call, ...
176- /// - clock: The clock to use as time source for the start time of the ``Span``
176+ /// - instant: the time instant at which the span started
177177/// - baggage: The `Baggage` providing information on where to start the new ``Span``.
178178/// - kind: The ``SpanKind`` of the new ``Span``.
179179/// - function: The function name in which the span was started
@@ -183,9 +183,9 @@ public func startSpan(
183183/// - Returns: the value returned by `operation`
184184/// - Throws: the error the `operation` has thrown (if any)
185185@available ( macOS 10 . 15 , iOS 13 , tvOS 13 , watchOS 6 , * ) // for TaskLocal Baggage
186- public func withSpan< T, Clock : TracerClock > (
186+ public func withSpan< T, Instant : TracerInstant > (
187187 _ operationName: String ,
188- clock : Clock ,
188+ at instant : @autoclosure ( ) -> Instant ,
189189 baggage: @autoclosure ( ) -> Baggage = . current ?? . topLevel,
190190 ofKind kind: SpanKind = . internal,
191191 function: String = #function,
@@ -195,7 +195,7 @@ public func withSpan<T, Clock: TracerClock>(
195195) rethrows -> T {
196196 try InstrumentationSystem . legacyTracer. withAnySpan (
197197 operationName,
198- clock : DefaultTracerClock ( ) ,
198+ at : DefaultTracerClock . now ,
199199 baggage: baggage ( ) ,
200200 ofKind: kind,
201201 function: function,
@@ -240,7 +240,7 @@ public func withSpan<T>(
240240) rethrows -> T {
241241 try InstrumentationSystem . legacyTracer. withAnySpan (
242242 operationName,
243- clock : DefaultTracerClock ( ) ,
243+ at : DefaultTracerClock . now ,
244244 baggage: baggage ( ) ,
245245 ofKind: kind,
246246 function: function,
@@ -267,7 +267,7 @@ public func withSpan<T>(
267267///
268268/// - Parameters:
269269/// - operationName: The name of the operation being traced. This may be a handler function, database call, ...
270- /// - clock: The clock to use as time source for the start time of the ``Span``
270+ /// - instant: the time instant at which the span started
271271/// - baggage: The `Baggage` providing information on where to start the new ``Span``.
272272/// - kind: The ``SpanKind`` of the new ``Span``.
273273/// - function: The function name in which the span was started
@@ -280,15 +280,15 @@ public func withSpan<T>(
280280 _ operationName: String ,
281281 baggage: @autoclosure ( ) -> Baggage = . current ?? . topLevel,
282282 ofKind kind: SpanKind = . internal,
283- clock : some TracerClock = DefaultTracerClock ( ) ,
283+ at instant : @autoclosure ( ) -> some TracerInstant = DefaultTracerClock . now ,
284284 function: String = #function,
285285 file fileID: String = #fileID,
286286 line: UInt = #line,
287287 _ operation: ( any Span ) throws -> T
288288) rethrows -> T {
289289 try InstrumentationSystem . legacyTracer. withAnySpan (
290290 operationName,
291- clock : clock ,
291+ at : instant ( ) ,
292292 baggage: baggage ( ) ,
293293 ofKind: kind,
294294 function: function,
@@ -316,7 +316,7 @@ public func withSpan<T>(
316316///
317317/// - Parameters:
318318/// - operationName: The name of the operation being traced. This may be a handler function, database call, ...
319- /// - clock: The clock to use as time source for the start time of the ``Span``
319+ /// - instant: the time instant at which the span started
320320/// - baggage: The `Baggage` providing information on where to start the new ``Span``.
321321/// - kind: The ``SpanKind`` of the new ``Span``.
322322/// - function: The function name in which the span was started
@@ -326,9 +326,9 @@ public func withSpan<T>(
326326/// - Returns: the value returned by `operation`
327327/// - Throws: the error the `operation` has thrown (if any)
328328@available ( macOS 10 . 15 , iOS 13 , tvOS 13 , watchOS 6 , * ) // for TaskLocal Baggage
329- public func withSpan< T, Clock : TracerClock > (
329+ public func withSpan< T, Instant : TracerInstant > (
330330 _ operationName: String ,
331- clock : Clock ,
331+ at instant : @autoclosure ( ) -> Instant ,
332332 baggage: @autoclosure ( ) -> Baggage = . current ?? . topLevel,
333333 ofKind kind: SpanKind = . internal,
334334 function: String = #function,
@@ -338,7 +338,7 @@ public func withSpan<T, Clock: TracerClock>(
338338) async rethrows -> T {
339339 try await InstrumentationSystem . legacyTracer. withAnySpan (
340340 operationName,
341- clock : DefaultTracerClock ( ) ,
341+ at : DefaultTracerClock . now ,
342342 baggage: baggage ( ) ,
343343 ofKind: kind,
344344 function: function,
@@ -383,7 +383,7 @@ public func withSpan<T>(
383383) async rethrows -> T {
384384 try await InstrumentationSystem . legacyTracer. withAnySpan (
385385 operationName,
386- clock : DefaultTracerClock ( ) ,
386+ at : DefaultTracerClock . now ,
387387 baggage: baggage ( ) ,
388388 ofKind: kind,
389389 function: function,
@@ -411,7 +411,7 @@ public func withSpan<T>(
411411/// - operationName: The name of the operation being traced. This may be a handler function, database call, ...
412412/// - baggage: The `Baggage` providing information on where to start the new ``Span``.
413413/// - kind: The ``SpanKind`` of the new ``Span``.
414- /// - clock: The clock to use as time source for the start time of the ``Span``
414+ /// - instant: the time instant at which the span started
415415/// - function: The function name in which the span was started
416416/// - fileID: The `fileID` where the span was started.
417417/// - line: The file line where the span was started.
@@ -422,15 +422,15 @@ public func withSpan<T>(
422422 _ operationName: String ,
423423 baggage: @autoclosure ( ) -> Baggage = . current ?? . topLevel,
424424 ofKind kind: SpanKind = . internal,
425- clock : some TracerClock = DefaultTracerClock ( ) ,
425+ at instant : @autoclosure ( ) -> some TracerInstant = DefaultTracerClock . now ,
426426 function: String = #function,
427427 file fileID: String = #fileID,
428428 line: UInt = #line,
429429 _ operation: ( any Span ) async throws -> T
430430) async rethrows -> T {
431431 try await InstrumentationSystem . legacyTracer. withAnySpan (
432432 operationName,
433- clock : clock ,
433+ at : instant ( ) ,
434434 baggage: baggage ( ) ,
435435 ofKind: kind,
436436 function: function,
0 commit comments