Skip to content

Commit 4cfce6b

Browse files
authored
Updated layout in instrumentation/swift/libraries.md (open-telemetry#2060)
1 parent 985004c commit 4cfce6b

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

content/en/docs/instrumentation/swift/libraries.md

+27-19
Original file line numberDiff line numberDiff line change
@@ -68,34 +68,42 @@ Initialize the class with
6868
to automatically capture all network calls.
6969

7070
This behavior can be modified or augmented by using the optional callbacks
71-
defined in `URLSessionInstrumentationConfiguration` :
71+
defined in `URLSessionInstrumentationConfiguration`:
7272

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.
7576

76-
`shouldRecordPayload: ((URLSession) -> (Bool)?)?`: Implement if you want the
77-
session to record payload data, false by default.
77+
- `shouldRecordPayload: ((URLSession) -> (Bool)?)?`
7878

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.
8280

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)?)?`
8582

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.
8885

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)?`
9187

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.
9489

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)?)?`
9791

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.
99107
`URLSessionInstrumentationConfiguration`'s construction can be passed the
100108
parameters defined above to suit the needs of the application.
101109

0 commit comments

Comments
 (0)