Skip to content

Commit 20ec488

Browse files
authored
Merge pull request #93 from slashmo/feature/write-only-span-events
Remove events getter from Span protocol
2 parents 208e169 + e9c7d61 commit 20ec488

File tree

4 files changed

+2
-11
lines changed

4 files changed

+2
-11
lines changed

Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/Instrumentation/Tracing/NoOpTracing.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ public struct NoOpTracingInstrument: TracingInstrument {
5151
.init()
5252
}
5353

54-
public var events: [SpanEvent] {
55-
[]
56-
}
57-
5854
public mutating func addLink(_ link: SpanLink) {}
5955

6056
public mutating func addEvent(_ event: SpanEvent) {}

Sources/Instrumentation/Tracing/Span.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ public protocol Span {
3939
/// The read-only `BaggageContext` of this `Span`, set when starting this `Span`.
4040
var baggage: BaggageContext { get }
4141

42-
/// The read-only collection of events which happened within this `Span`.
43-
///
44-
/// `SpanEvent`s might be added via the `addEvent` or `addingEvent` `Span` methods.
45-
var events: [SpanEvent] { get }
46-
4742
/// Add a `SpanEvent` in place.
4843
/// - Parameter event: The `SpanEvent` to add to this `Span`.
4944
mutating func addEvent(_ event: SpanEvent)

Tests/InstrumentationTests/Tracing/TracedLockTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private final class TracedLockPrintlnTracer: TracingInstrument {
9494

9595
private(set) var links = [SpanLink]()
9696

97-
private(set) var events = [SpanEvent]() {
97+
private var events = [SpanEvent]() {
9898
didSet {
9999
self.isRecording = !self.events.isEmpty
100100
}

0 commit comments

Comments
 (0)