Skip to content

Commit ddc7470

Browse files
heckjslashmo
andauthored
update documentation references to fix broken reference links on SwiftPackageIndex hosted documentation for main (#143)
Co-authored-by: Moritz Lang <[email protected]>
1 parent 7fbb8b2 commit ddc7470

7 files changed

+18
-18
lines changed

Sources/Tracing/Docs.docc/Guides/InstrumentYourLibrary.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func handler(request: HTTPRequest) async {
238238
}
239239
```
240240

241-
This is introducing multiple layers of nesting, and we have un-necessarily restored, picked-up, and restored the context again. In order to avoid this duplicate work, it is beneficial to use the ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` overload, which also accepts a `ServiceContext` as parameter, rather than picking it up from the task-local value:
241+
This is introducing multiple layers of nesting, and we have un-necessarily restored, picked-up, and restored the context again. In order to avoid this duplicate work, it is beneficial to use the ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` overload, which also accepts a `ServiceContext` as parameter, rather than picking it up from the task-local value:
242242

243243
```swift
244244
// BETTER
@@ -257,7 +257,7 @@ This method will only restore the context once, after the tracer has had a chanc
257257

258258
#### Manual Span Lifetime Management
259259

260-
While the ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` API is preferable in most situations, it may not be possible to use when the lifetime of a span only terminates in yet another callback API. In such situations, it may be impossible to "wrap" the entire piece of code that would logically represent "the span" using a `withSpan(...) { ... }` call.
260+
While the ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` API is preferable in most situations, it may not be possible to use when the lifetime of a span only terminates in yet another callback API. In such situations, it may be impossible to "wrap" the entire piece of code that would logically represent "the span" using a `withSpan(...) { ... }` call.
261261

262262
In such situations you can resort to using the ``startSpan(_:context:ofKind:at:function:file:line:)`` and ``Span/end()`` APIs explicitly. Those APIs can then be used like this:
263263

Sources/Tracing/Docs.docc/Guides/TraceYourApplication.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ This was just a quick introduction to tracing, but hopefully you are now excited
258258
259259
### Efficiently working with Spans
260260
261-
We already saw the basic API to spawn a trace span, the ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` method, but we didn't discuss it in depth yet. In this section we'll discuss how to efficiently work with spans and some common patterns and practices.
261+
We already saw the basic API to spawn a trace span, the ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` method, but we didn't discuss it in depth yet. In this section we'll discuss how to efficiently work with spans and some common patterns and practices.
262262
263263
Firstly, spans are created using a `withSpan` call and performing the operation contained within the span in the trailing operation closure body. This is important because it automatically, and correctly, delimits the lifetime of the span: from its creation, until the operation closure returns:
264264

Sources/Tracing/Docs.docc/Tracer.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
### Creating Spans
66

7-
- ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b``
7+
- ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v``
88

99
### Manual Span management
1010

11-
- ``startSpan(_:context:ofKind:at:function:file:line:)-u1y4``
11+
- ``startSpan(_:context:ofKind:at:function:file:line:)-c9un``
1212
- ``Span/end()``

Sources/Tracing/SpanProtocol.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ extension Span {
136136
/// Implementations SHOULD prevent double-emitting by marking a span as ended internally, however it still is a
137137
/// programming mistake to rely on this behavior.
138138
///
139-
/// - SeeAlso: ``end(clock:)`` which allows passing in a specific time, e.g. if the operation was ended and recorded somewhere and we need to post-factum record it.
139+
/// - SeeAlso: ``end(at:)`` which allows passing in a specific time, e.g. if the operation was ended and recorded somewhere and we need to post-factum record it.
140140
/// Generally though prefer using the ``end()`` version of this API in user code and structure your system such that it can be called in the right place and time.
141141
public func end() {
142142
self.end(at: DefaultTracerClock.now)

Sources/Tracing/Tracer.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Dispatch
2424
/// we're about to start a top-level span, or if a span should be started from a different,
2525
/// stored away previously,
2626
///
27-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
27+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
2828
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
2929
/// Use `startSpan` iff you need to pass the span manually to a different
3030
/// location in your source code to end it.
@@ -71,7 +71,7 @@ public func startSpan<Instant: TracerInstant>(
7171
/// we're about to start a top-level span, or if a span should be started from a different,
7272
/// stored away previously,
7373
///
74-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
74+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
7575
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
7676
/// Use `startSpan` iff you need to pass the span manually to a different
7777
/// location in your source code to end it.
@@ -116,7 +116,7 @@ public func startSpan(
116116
/// we're about to start a top-level span, or if a span should be started from a different,
117117
/// stored away previously,
118118
///
119-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
119+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
120120
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
121121
/// Use `startSpan` iff you need to pass the span manually to a different
122122
/// location in your source code to end it.

Sources/Tracing/TracerProtocol+Legacy.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Dispatch
2121
/// **This protocol will be deprecated as soon as possible**, and the library will continue recommending Swift 5.7+
2222
/// in order to make use of new language features that make expressing the tracing API free of existential types when not necessary.
2323
///
24-
/// When possible, prefer using ``Tracer`` and ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` APIs,
24+
/// When possible, prefer using ``Tracer`` and ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` APIs,
2525
/// rather than these `startAnySpan` APIs which unconditionally always return existential Spans even when not necessary
2626
/// (under Swift 5.7+ type-system enhancement wrt. protocols with associated types)..
2727
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal ServiceContext
@@ -39,7 +39,7 @@ public protocol LegacyTracer: Instrument {
3939
///
4040
/// - Note: Legacy API, prefer using ``startSpan(_:context:ofKind:at:
4141
///
42-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
42+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
4343
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
4444
/// Use `startSpan` iff you need to pass the span manually to a different
4545
/// location in your source code to end it.
@@ -96,7 +96,7 @@ extension LegacyTracer {
9696
///
9797
/// - Note: Legacy API, prefer using ``startSpan(_:context:ofKind:at:
9898
///
99-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
99+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
100100
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
101101
/// Use `startSpan` iff you need to pass the span manually to a different
102102
/// location in your source code to end it.
@@ -146,7 +146,7 @@ extension LegacyTracer {
146146
///
147147
/// - Note: Legacy API, prefer using ``startSpan(_:context:ofKind:at:
148148
///
149-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
149+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
150150
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
151151
/// Use `startSpan` iff you need to pass the span manually to a different
152152
/// location in your source code to end it.
@@ -407,7 +407,7 @@ extension Tracer {
407407
///
408408
/// - Note: Legacy API, prefer using ``startSpan(_:context:ofKind:at:
409409
///
410-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
410+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
411411
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
412412
/// Use `startSpan` iff you need to pass the span manually to a different
413413
/// location in your source code to end it.
@@ -456,7 +456,7 @@ extension Tracer {
456456
///
457457
/// - Note: Legacy API, prefer using ``startSpan(_:context:ofKind:at:
458458
///
459-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
459+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
460460
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
461461
/// Use `startSpan` iff you need to pass the span manually to a different
462462
/// location in your source code to end it.
@@ -511,7 +511,7 @@ extension Tracer {
511511
///
512512
/// - Note: Legacy API, prefer using ``startSpan(_:context:ofKind:at:
513513
///
514-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
514+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
515515
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
516516
/// Use `startSpan` iff you need to pass the span manually to a different
517517
/// location in your source code to end it.

Sources/Tracing/TracerProtocol.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public protocol Tracer: LegacyTracer {
3434
/// we're about to start a top-level span, or if a span should be started from a different,
3535
/// stored away previously,
3636
///
37-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
37+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
3838
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
3939
/// Use `startSpan` iff you need to pass the span manually to a different
4040
/// location in your source code to end it.
@@ -71,7 +71,7 @@ extension Tracer {
7171
/// we're about to start a top-level span, or if a span should be started from a different,
7272
/// stored away previously,
7373
///
74-
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-4o2b`` to start
74+
/// - Note: Prefer ``withSpan(_:context:ofKind:at:function:file:line:_:)-8gw3v`` to start
7575
/// a span as it automatically takes care of ending the span, and recording errors when thrown.
7676
/// Use `startSpan` iff you need to pass the span manually to a different
7777
/// location in your source code to end it.

0 commit comments

Comments
 (0)