@@ -25,7 +25,7 @@ extension Span {
2525 return " \( method) \( target) "
2626 }
2727
28- /// Add `traceparent` header to a URLRequest if we're sampling
28+ /// Sets the `traceparent` header on a URLRequest if we're sampling.
2929 /// - Parameter isSampling: whether we are sampling, defaults to InstrumentationSystem.tracer.isSampling
3030 /// - Parameter urlRequest: urlRequest to modify
3131 public func addTraceHeadersIfSampling(
@@ -34,19 +34,19 @@ extension Span {
3434 ) {
3535 if isSampling {
3636 let value = traceParentHeaderValue ( sampled: true )
37- urlRequest. addValue ( value. 1 , forHTTPHeaderField: value. 0 )
37+ urlRequest. setValue ( value. 1 , forHTTPHeaderField: value. 0 )
3838 }
3939 }
4040
41- /// Add `traceparent` header to a URLRequest regardless of sampling state
41+ /// Sets the `traceparent` header on a URLRequest regardless of sampling state.
4242 /// Sampled flag determined from InstrumentationSystem.tracer.isSampling
4343 /// - Parameter urlRequest: urlRequest to modify
4444 public func addTraceHeadersUnconditionally(
4545 _ urlRequest: inout URLRequest ,
4646 isSampling: Bool = InstrumentationSystem . tracer. isSampling
4747 ) {
4848 let value = traceParentHeaderValue ( sampled: isSampling)
49- urlRequest. addValue ( value. 1 , forHTTPHeaderField: value. 0 )
49+ urlRequest. setValue ( value. 1 , forHTTPHeaderField: value. 0 )
5050 }
5151
5252 /// Annotates the span with attributes from URLSessionTaskMetrics.
0 commit comments