@@ -20,7 +20,8 @@ public struct URLSessionInstrumentationConfiguration {
2020 injectCustomHeaders: ( ( inout URLRequest , Span ? ) -> Void ) ? = nil ,
2121 createdRequest: ( ( URLRequest , Span ) -> Void ) ? = nil ,
2222 receivedResponse: ( ( URLResponse , DataOrFile ? , Span ) -> Void ) ? = nil ,
23- receivedError: ( ( Error , DataOrFile ? , HTTPStatus , Span ) -> Void ) ? = nil )
23+ receivedError: ( ( Error , DataOrFile ? , HTTPStatus , Span ) -> Void ) ? = nil ,
24+ delegateClassesToInstrument: [ AnyClass ] ? = nil )
2425 {
2526 self . shouldRecordPayload = shouldRecordPayload
2627 self . shouldInstrument = shouldInstrument
@@ -31,6 +32,7 @@ public struct URLSessionInstrumentationConfiguration {
3132 self . createdRequest = createdRequest
3233 self . receivedResponse = receivedResponse
3334 self . receivedError = receivedError
35+ self . delegateClassesToInstrument = delegateClassesToInstrument
3436 }
3537
3638 // Instrumentation Callbacks
@@ -65,4 +67,7 @@ public struct URLSessionInstrumentationConfiguration {
6567
6668 /// Called before the span is ended, it allows to add extra information to the Span
6769 public var receivedError : ( ( Error , DataOrFile ? , HTTPStatus , Span ) -> Void ) ?
70+
71+ /// The array of URLSession delegate classes that will be instrumented by the library, will autodetect if nil is passed.
72+ public var delegateClassesToInstrument : [ AnyClass ] ?
6873}
0 commit comments