This page lists integrated libraries you can use for iOS and tvOS applications.

Alamofire

Starting from version 2.5.0, the RUM iOS SDK can automatically track Alamofire requests.

  1. Configure RUM monitoring by following the Setup guide.
  2. Enable URLSessionInstrumentation for Alamofire.SessionDelegate:
import Alamofire
import DatadogRUM

URLSessionInstrumentation.enable(with: .init(delegateClass: Alamofire.SessionDelegate.self))

For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, refer to Advanced Configuration > Automatically track network requests.

Apollo GraphQL

Starting from version 2.5.0, the RUM iOS SDK can automatically track Apollo GraphQL requests.

  1. Configure RUM monitoring by following the Setup guide.
  2. Enable URLSessionInstrumentation for Apollo.URLSessionClient:
import Apollo
import DatadogRUM

URLSessionInstrumentation.enable(with: .init(delegateClass: Apollo.URLSessionClient.self))

For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, see Advanced Configuration > Automatically track network requests.

  1. Add the Datadog Apollo interceptor package to your Package.swift file:

    dependencies: [
        .package(url: "https://github.com/DataDog/dd-sdk-ios-apollo-interceptor", .upToNextMajor(from: "1.0.0"))
    ]
    
  2. Add the Datadog interceptor to your Apollo Client setup:

    import Apollo
    import DatadogApollo
    
    class CustomInterceptorProvider: DefaultInterceptorProvider {
        override func interceptors<Operation: GraphQLOperation>(for operation: Operation) -> [ApolloInterceptor] {
            var interceptors = super.interceptors(for: operation)
            interceptors.insert(DatadogApollo.createInterceptor(), at: 0)
            return interceptors
        }
    }
    

For additional information on distributed tracing, adding custom attributes, and enabling GraphQL payload tracking, see Advanced Configuration > Apollo instrumentation.

SDWebImage

Starting from version 2.5.0, the RUM iOS SDK can automatically track SDWebImage requests.

  1. Configure RUM monitoring by following the Setup guide.
  2. Enable URLSessionInstrumentation for SDWebImageDownloader:
import SDWebImage
import DatadogRUM

URLSessionInstrumentation.enable(with: .init(delegateClass: SDWebImageDownloader.self as! URLSessionDataDelegate.Type))

For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, see Advanced Configuration > Automatically track network requests.

OpenAPI Generator

Starting from version 2.5.0, the RUM iOS SDK can automatically track OpenAPI Generator requests.

  1. Configure RUM monitoring by following the Setup guide.
  2. Create a dummy URLSessionDataDelegate.
  3. Enable URLSessionInstrumentation for EmptySessionDelegate.
  4. Configure URLSession with your dummy URLSessionDataDelegate.
  5. Create an OpenAPI client with .buffered processing mode.
import DatadogRUM
import OpenAPIRuntime
import OpenAPIURLSession

// Dummy delegate
class EmptySessionDelegate: NSObject, URLSessionDataDelegate {}

// Create `URLSession` with your delegate
let delegate = EmptySessionDelegate()
let urlSession = URLSession(configuration: .default, delegate: delegate, delegateQueue: nil)

// Enable instrumentation for your delegate class
URLSessionInstrumentation.enable(with: .init(delegateClass: EmptySessionDelegate.self))

// Create transport with `.buffered` processing mode (required for proper instrumentation)
let transport = URLSessionTransport(configuration: .init(
    session: urlSession,
    httpBodyProcessingMode: .buffered
))

// Create the OpenAPI client
bufferedClient = Client(
    serverURL: try! Servers.Server1.url(),
    transport: transport
)

For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, see Advanced Configuration > Automatically track network requests.