Skip to content

Commit bb8839b

Browse files
committed
Fix compilation without DistributedTracingSupport trait
Signed-off-by: Moritz Lang <[email protected]>
1 parent 960c035 commit bb8839b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Valkey/Connection/ValkeyConnection.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public final actor ValkeyConnection: ValkeyClientProtocol, Sendable {
6363
self.logger = logger
6464
#if DistributedTracingSupport
6565
self.tracer = configuration.tracing.tracer
66-
#endif
6766
switch address?.value {
6867
case let .hostname(host, port):
6968
self.address = (host, port)
@@ -72,6 +71,7 @@ public final actor ValkeyConnection: ValkeyClientProtocol, Sendable {
7271
case nil:
7372
self.address = nil
7473
}
74+
#endif
7575
self.isClosed = .init(false)
7676
}
7777

@@ -263,6 +263,7 @@ public final actor ValkeyConnection: ValkeyClientProtocol, Sendable {
263263
}
264264
}
265265

266+
#if DistributedTracingSupport
266267
@usableFromInline
267268
func applyCommonAttributes(to attributes: inout SpanAttributes, commandName: String) {
268269
attributes[self.configuration.tracing.attributeNames.databaseOperationName] = commandName
@@ -272,6 +273,7 @@ public final actor ValkeyConnection: ValkeyClientProtocol, Sendable {
272273
attributes[self.configuration.tracing.attributeNames.serverAddress] = address?.hostOrSocketPath
273274
attributes[self.configuration.tracing.attributeNames.serverPort] = address?.port == 6379 ? nil : address?.port
274275
}
276+
#endif
275277

276278
@usableFromInline
277279
nonisolated func cancel(requestID: Int) {

0 commit comments

Comments
 (0)