@@ -68,34 +68,42 @@ Initialize the class with
68
68
to automatically capture all network calls.
69
69
70
70
This behavior can be modified or augmented by using the optional callbacks
71
- defined in ` URLSessionInstrumentationConfiguration ` :
71
+ defined in ` URLSessionInstrumentationConfiguration ` :
72
72
73
- ` shouldInstrument: ((URLRequest) -> (Bool)?)? ` : Filter which requests you want
74
- to instrument, all by default
73
+ - ` shouldInstrument: ((URLRequest) -> (Bool)?)? `
74
+
75
+ Filter which requests you want to instrument, all by default.
75
76
76
- ` shouldRecordPayload: ((URLSession) -> (Bool)?)? ` : Implement if you want the
77
- session to record payload data, false by default.
77
+ - ` shouldRecordPayload: ((URLSession) -> (Bool)?)? `
78
78
79
- ` shouldInjectTracingHeaders: ((URLRequest) -> (Bool)?)? ` : Allows filtering which
80
- requests you want to inject headers to follow the trace, true by default. You
81
- must also return true if you want to inject custom headers.
79
+ Implement if you want the session to record payload data, false by default.
82
80
83
- ` injectCustomHeaders: ((inout URLRequest, Span?) -> Void)? ` : Implement this
84
- callback to inject custom headers or modify the request in any other way
81
+ - ` shouldInjectTracingHeaders: ((URLRequest) -> (Bool)?)? `
85
82
86
- ` nameSpan: ((URLRequest) -> (String)?)? ` - Modifies the name for the given
87
- request instead of standard OpenTelemetry name
83
+ Allow filtering which requests you want to inject headers to follow the trace,
84
+ true by default. You must also return true if you want to inject custom headers.
88
85
89
- ` createdRequest: ((URLRequest, Span) -> Void)? ` - Called after request is
90
- created, it allows to add extra information to the Span
86
+ - ` injectCustomHeaders: ((inout URLRequest, Span?) -> Void)? `
91
87
92
- ` receivedResponse: ((URLResponse, DataOrFile?, Span) -> Void)? ` - Called after
93
- response is received, it allows to add extra information to the Span
88
+ Implement this callback to inject custom headers or modify the request in any other way.
94
89
95
- ` receivedError: ((Error, DataOrFile?, HTTPStatus, Span) -> Void)? ` - Called
96
- after an error is received, it allows to add extra information to the Span
90
+ - ` nameSpan: ((URLRequest) -> (String)?)? `
97
91
98
- below is an example of initialization.
92
+ Modify the name for the given request instead of standard OpenTelemetry name.
93
+
94
+ - ` createdRequest: ((URLRequest, Span) -> Void)? `
95
+
96
+ Called after request is created, it allows to add extra information to the Span.
97
+
98
+ - ` receivedResponse: ((URLResponse, DataOrFile?, Span) -> Void)? `
99
+
100
+ Called after response is received, it allows to add extra information to the Span.
101
+
102
+ - ` receivedError: ((Error, DataOrFile?, HTTPStatus, Span) -> Void)? `
103
+
104
+ Called after an error is received, it allows to add extra information to the Span.
105
+
106
+ Below is an example of initialization.
99
107
` URLSessionInstrumentationConfiguration ` 's construction can be passed the
100
108
parameters defined above to suit the needs of the application.
101
109
0 commit comments