Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -753,49 +753,6 @@ URLSessionInstrumentation.disable(delegateClass: <YourSessionDelegate>.self)
{{% /tab %}}
{{< /tabs >}}

#### Apollo instrumentation

1. Set up [RUM monitoring with Datadog iOS RUM][2].

2. Set up [URLSession instrumentation with the Datadog RUM SDK](#basic-network-instrumentation).

3. Add the following to your `Package.swift` file:

```swift
dependencies: [
.package(url: "https://github.com/DataDog/dd-sdk-ios-apollo-interceptor", .upToNextMajor(from: "1.0.0"))
]
```

4. Add the Datadog interceptor to your Apollo Client setup:

```swift
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
}
}
```

This automatically adds Datadog headers to your GraphQL requests, allowing them to be tracked by Datadog.

<div class="alert alert-info">
<ul>
<li>The integration supports Apollo iOS version <code>1.0</code> and later.</li>
<li>The <code>query</code> and <code>mutation</code> type operations are tracked, <code>subscription</code> operations are not.</li>
<li>GraphQL payload sending is disabled by default. To enable it, set the <code>sendGraphQLPayloads</code> flag in the <code>DatadogApollo</code> interceptor constructor as follows:</li>
</ul>

<pre><code class="language-swift">
let datadogInterceptor = DatadogApollo.createInterceptor(sendGraphQLPayloads: true)
</code></pre>
</div>

### Automatically track errors

All "error" and "critical" logs sent with `Logger` are automatically reported as RUM errors and linked to the current RUM view:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ further_reading:
- link: https://github.com/DataDog/dd-sdk-ios
tag: "Source Code"
text: Source code for dd-sdk-ios
- link: https://github.com/DataDog/dd-sdk-ios-apollo-interceptor
tag: "Source Code"
text: Datadog Integration for Apollo iOS
---

This page lists integrated libraries you can use for iOS and tvOS applications.
Expand Down Expand Up @@ -48,31 +45,6 @@ For additional information on sampling rate, distributed tracing, and adding cus
attributes to tracked RUM resources, see [Advanced Configuration > Automatically track
network requests][4].

3. Add the [Datadog Apollo interceptor][8] package to your `Package.swift` file:

```swift
dependencies: [
.package(url: "https://github.com/DataDog/dd-sdk-ios-apollo-interceptor", .upToNextMajor(from: "1.0.0"))
]
```

4. Add the Datadog interceptor to your Apollo Client setup:

```swift
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][7].

## SDWebImage

Starting from version `2.5.0`, the RUM iOS SDK can automatically track [SDWebImage][5] requests.
Expand Down Expand Up @@ -133,5 +105,3 @@ For additional information on sampling rate, distributed tracing, and adding cus
[4]: /real_user_monitoring/application_monitoring/ios/advanced_configuration/#automatically-track-network-requests
[5]: https://github.com/SDWebImage/SDWebImage
[6]: https://github.com/OpenAPITools/openapi-generator
[7]: /real_user_monitoring/application_monitoring/ios/advanced_configuration/#apollo-instrumentation
[8]: https://github.com/DataDog/dd-sdk-ios-apollo-interceptor
Loading