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

Alamofire

Starting from version 3.7.0, the RUM iOS SDK automatically tracks Alamofire requests after you enable RUM with urlSessionTracking configuration.

  1. Configure RUM monitoring by following the Setup guide.
  2. (Optional) For detailed timing breakdown (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable URLSessionInstrumentation for Alamofire.SessionDelegate:
import Alamofire
import DatadogRUM

URLSessionInstrumentation.enableDurationBreakdown(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 3.7.0, the RUM iOS SDK automatically tracks Apollo GraphQL requests after you enable RUM with urlSessionTracking configuration.

  1. Configure RUM monitoring by following the Setup guide.
  2. (Optional) For detailed timing breakdown (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable URLSessionInstrumentation for Apollo.URLSessionClient:
import Apollo
import DatadogRUM

URLSessionInstrumentation.enableDurationBreakdown(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.

For more advanced Apollo integration using the Datadog Apollo interceptor, see the Datadog Apollo interceptor package and Apollo instrumentation.

SDWebImage

Starting from version 3.7.0, the RUM iOS SDK automatically tracks SDWebImage requests after you enable RUM with urlSessionTracking configuration.

  1. Configure RUM monitoring by following the Setup guide.
  2. (Optional) For detailed timing breakdown (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable URLSessionInstrumentation for SDWebImageDownloader:
import SDWebImage
import DatadogRUM

URLSessionInstrumentation.enableDurationBreakdown(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 3.7.0, the RUM iOS SDK automatically tracks OpenAPI Generator requests after you enable RUM with urlSessionTracking configuration.

For detailed timing breakdown (DNS resolution, SSL handshake, time to first byte, connection time, download duration), follow these steps:

  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.enableDurationBreakdown(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.