Skip to content

Latest commit

 

History

History
 
 

Alamofire

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Datadog Integration for Alamofire

DatadogAlamofireExtension enables Alamofire.Session auto instrumentation with Datadog SDK. It's a counterpart of DDURLSessionDelegate, which is provided for native URLSession instrumentation.

Getting started

CocoaPods

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.

Carthage and SPM

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.

Initial setup

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.

Contributing

Pull requests are welcome. First, open an issue to discuss what you would like to change. For more information, read the Contributing Guide.

License

Apache License, v2.0