Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUM-3060 Add docs for RUM iOS SDK Integrated Libraries #24253

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
@@ -0,0 +1,52 @@
---
title: iOS and tvOS Libraries for RUM
code_lang: ios
type: multi-code-lang
code_lang_weight: 10
aliases:
- /real_user_monitoring/ios/integrated_libraries/
further_reading:
- link: https://github.com/DataDog/dd-sdk-ios
tag: "Source Code"
text: Source code for dd-sdk-ios
- link: /real_user_monitoring/mobile_and_tv_monitoring/integrated_libraries
tag: Documentation
text: Integrated Libraries
---

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][1] requests.

1. Configure RUM monitoring by following the [Setup][2] guide.
2. Enable `URLSessionInstrumentation` for `Alamofire.SessionDelegate`:

```swift
import Alamofire
import DatadogRUM

URLSessionInstrumentation.enable(with: .init(delegateClass: SessionDelegate.self))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/improvement

have seen some customer asking where is SessionDelegate type.

We should make sure from docs that it clearly states that SessionDelegate is a customer type and implemented in their app.

Copy link
Member Author

@ncreated ncreated Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is Alamofire's type 🤔 💭. Which is already covered in:

  1. Enable URLSessionInstrumentation for Alamofire.SessionDelegate:

I can make it cleaner by:

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

WDYT @ganeshnj ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately, I decided to add Alamofire. namespace, same as for Apollo. I also considered linking to Alamofire.SessionDelegate doc, but decided to not do it as external links are likely to change making our docs out-of-sync.

```
For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, refer to "Automatically track network requests" in the [Advanced Configuration][4] documentation.
ncreated marked this conversation as resolved.
Show resolved Hide resolved
ncreated marked this conversation as resolved.
Show resolved Hide resolved

## Apollo GraphQL

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

1. Configure RUM monitoring by following the [Setup][2] guide.
2. Enable `URLSessionInstrumentation` for `Apollo.URLSessionClient`:

```swift
import Apollo
import DatadogRUM

URLSessionInstrumentation.enable(with: .init(delegateClass: URLSessionClient.self))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/improvement

URLSessionClient is very common name, let's namespace it/

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍. I also considered linking Apollo.URLSessionClient doc but decided to not do it as external links are likely to change making our docs out-of-sync.

```
For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, refer to "Automatically track network requests" in the [Advanced Configuration][4] documentation.
cswatt marked this conversation as resolved.
Show resolved Hide resolved

[1]: https://github.com/Alamofire/Alamofire
[2]: https://docs.datadoghq.com/real_user_monitoring/mobile_and_tv_monitoring/setup/ios/
[3]: https://github.com/apollographql/apollo-ios
[4]: https://docs.datadoghq.com/real_user_monitoring/mobile_and_tv_monitoring/advanced_configuration/ios/#automatically-track-network-requests
7 changes: 7 additions & 0 deletions layouts/partials/rum/rum-mobile-integrated-libraries.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
</div>
</a>
</div>
<div class="col">
<a class="card h-100" href="/real_user_monitoring/mobile_and_tv_monitoring/integrated_libraries/ios/">
<div class="card-body text-center py-2 px-1">
{{ partial "img.html" (dict "root" . "src" "integrations_logos/ios_large.svg" "class" "img-fluid" "alt" "ios" "width" "200") }}
</div>
</a>
</div>
<div class="col">
<a class="card h-100" href="/real_user_monitoring/mobile_and_tv_monitoring/integrated_libraries/reactnative/">
<div class="card-body text-center py-2 px-1">
Expand Down
Loading