Skip to content

Commit

Permalink
Disable client spans due to performance investigation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Pilkington committed Sep 12, 2023
1 parent 0176dde commit 3a47512
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions Sources/SmokeHTTPClient/HTTPOperationsClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -620,26 +620,8 @@ extension HTTPOperationsClient {
context: ServiceContext? = ServiceContext.current,
ofKind kind: SpanKind = .internal,
_ operation: ((any Span)?) async throws -> T) async rethrows -> T {
if let context = context {
return try await withSpan(operationName, context: context, ofKind: kind) { span in
do {
return try await operation(span)
} catch let error as HTTPClientError {
span.attributes["http.status_code"] = error.responseCode
span.setStatus(.init(code: .error))

// rethrow error
throw error
} catch {
span.setStatus(.init(code: .error))

// rethrow error
throw error
}
}
} else {
return try await operation(nil)
}
// disable client spans due to performance investigation
return try await operation(nil)
}
}

Expand Down

0 comments on commit 3a47512

Please sign in to comment.