Skip to content

Commit

Permalink
Merge pull request #132 from amzn/disable_client_spans
Browse files Browse the repository at this point in the history
Disable client spans due to performance investigation.
  • Loading branch information
tachyonics authored Sep 13, 2023
2 parents 0176dde + 3a47512 commit 971e77e
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 971e77e

Please sign in to comment.