DatadogAlamofireExtension enables Alamofire.Session auto instrumentation with Datadog SDK.
It's a counterpart of DDURLSessionDelegate, which is provided for native URLSession instrumentation.
To include the Datadog integration for Alamofire in your project, add the
following to your Podfile:
pod 'DatadogSDKAlamofireExtension'DatadogSDKAlamofireExtension requires Datadog SDK 1.5.0 or higher and Alamofire 5.0 or higher.
The Datadog Alamofire integration doesn't support Carthage or SPM, however, the code needed for set up is very low. You may want to include the source files from this folder directly in your project.
Follow the regular steps for initializing Datadog SDK for Tracing or RUM.
Instead of using DDURLSessionDelegate for URLSession, use DDEventMonitor and DDRequestInterceptor for Alamofire.Session:
import DatadogAlamofireExtension
import Alamofire
let alamofireSession = Session(
interceptor: DDRequestInterceptor(),
eventMonitors: [DDEventMonitor()]
)Using this setup makes the Datadog SDK track requests from this instance of the Alamofire.Session.
Pull requests are welcome. First, open an issue to discuss what you would like to change. For more information, read the Contributing Guide.