Network traffic (= traces) not captured for URLSession.data(...)
methods
#1288
Labels
bug
Something isn't working
URLSession.data(...)
methods
#1288
Hello,
In our iOS project we have set the Datadog SDK and activated trace collection.
The bug is that our requests/responses are not captured by Datadog. No trace is sent to Datadog server so we cannot find them into the Datadog UI.
After a little of investigation in the Datadog iOS SDK code, we noticed that there is a swizzling mechanism on
URLSession.dataTask()
methods. This mechanism is responsible for capturing traces.In our project, we do not use
URLSession.dataTask()
methods butURLSession.data()
methods which are their "async/await" version and available since iOS 15. More precisely, we observe that the following methods are not supported by this swizzling mechanism:URLSession.data(for: URLRequest) -> (Data, URLResponse)
URLSession.data(from: URL) -> (Data, URLResponse)
URLSession.data(for: URLRequest, delegate: (URLSessionTaskDelegate)?) -> (Data, URLResponse)
URLSession.data(from: URL, delegate: (URLSessionTaskDelegate)?) -> (Data, URLResponse)
Could you, please, update the code in order that the Datadog iOS SDK support these methods ?
The text was updated successfully, but these errors were encountered: