Skip to content

Commit 87791a4

Browse files
authored
Merge pull request #75 from slashmo/remove-current-span
Remove currentSpan from TracingInstrument API
2 parents 1c9c2b1 + a86c2ee commit 87791a4

File tree

4 files changed

+0
-10
lines changed

4 files changed

+0
-10
lines changed

Sources/Instrumentation/Tracing/NoOpTracing.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import Dispatch
1616

1717
/// No operation TracingInstrument, used when no tracing is required.
1818
public struct NoOpTracingInstrument: TracingInstrument {
19-
public var currentSpan: Span? = nil
20-
2119
public func startSpan(
2220
named operationName: String,
2321
context: BaggageContext,

Sources/Instrumentation/Tracing/TracingInstrument.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ import Dispatch
1717
/// An `Instrument` with added functionality for distributed tracing. Is uses the span-based tracing model and is
1818
/// based on the OpenTracing/OpenTelemetry spec.
1919
public protocol TracingInstrument: Instrument {
20-
/// The currently traces `Span`.
21-
var currentSpan: Span? { get }
22-
2320
/// Start a new `Span` within the given `BaggageContext` at a given timestamp.
2421
/// - Parameters:
2522
/// - operationName: The name of the operation being traced. This may be a handler function, database call, ...

Tests/InstrumentationTests/Tracing/TracedLockTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ enum TaskIDKey: BaggageContextKey {
5353
// MARK: PrintLn Tracer
5454

5555
private final class TracedLockPrintlnTracer: TracingInstrument {
56-
var currentSpan: Span? // FIXME: likely not like that
57-
5856
func startSpan(
5957
named operationName: String,
6058
context: BaggageContext,

Tests/InstrumentationTests/TracingInstrumentTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ final class TracingInstrumentTests: XCTestCase {
3232
// MARK: - JaegerTracer
3333

3434
final class JaegerTracer: TracingInstrument {
35-
private(set) var currentSpan: Span?
36-
3735
func startSpan(
3836
named operationName: String,
3937
context: BaggageContext,
@@ -49,7 +47,6 @@ final class JaegerTracer: TracingInstrument {
4947
span.baggage.logger.info(#"Emitting span "\#(span.operationName)" to backend"#)
5048
span.baggage.logger.info("\(span.attributes)")
5149
}
52-
currentSpan = span
5350
return span
5451
}
5552

0 commit comments

Comments
 (0)