File tree 2 files changed +2
-19
lines changed
Sources/Hummingbird/Middleware
2 files changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ let package = Package(
24
24
. package ( url: " https://github.com/apple/swift-log.git " , from: " 1.4.0 " ) ,
25
25
. package ( url: " https://github.com/apple/swift-http-types.git " , from: " 1.0.0 " ) ,
26
26
. package ( url: " https://github.com/apple/swift-metrics.git " , from: " 2.5.0 " ) ,
27
- . package ( url: " https://github.com/apple/swift-distributed-tracing.git " , from: " 1.0.1 " ) ,
27
+ . package ( url: " https://github.com/apple/swift-distributed-tracing.git " , from: " 1.1.0 " ) ,
28
28
. package ( url: " https://github.com/apple/swift-nio.git " , from: " 2.63.0 " ) ,
29
29
. package ( url: " https://github.com/apple/swift-nio-extras.git " , from: " 1.20.0 " ) ,
30
30
. package ( url: " https://github.com/apple/swift-nio-http2.git " , from: " 1.34.1 " ) ,
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public struct TracingMiddleware<Context: RequestContext>: RouterMiddleware {
51
51
// span name is updated after route has run
52
52
let operationName = " HTTP \( request. method. rawValue) route not found "
53
53
54
- let span = InstrumentationSystem . tracer . startSpan ( operationName, context: serviceContext, ofKind: . server)
54
+ let span = startSpan ( operationName, context: serviceContext, ofKind: . server)
55
55
span. updateAttributes { attributes in
56
56
if let staticAttributes = self . attributes {
57
57
attributes. merge ( staticAttributes)
@@ -176,20 +176,3 @@ private struct HTTPHeadersExtractor: Extractor {
176
176
return headers [ headerName]
177
177
}
178
178
}
179
-
180
- extension Span {
181
- /// Update Span attributes in a block instead of individually
182
- ///
183
- /// Updating a span attribute will involve some type of thread synchronisation
184
- /// primitive to avoid multiple threads updating the attributes at the same
185
- /// time. If you update each attributes individually this could cause slowdown.
186
- /// This function updates the attributes in one call to avoid hitting the
187
- /// thread synchronisation code multiple times
188
- ///
189
- /// - Parameter update: closure used to update span attributes
190
- func updateAttributes( _ update: ( inout SpanAttributes ) -> Void ) {
191
- var attributes = self . attributes
192
- update ( & attributes)
193
- self . attributes = attributes
194
- }
195
- }
You can’t perform that action at this time.
0 commit comments