- 重要な情報
- はじめに
- 用語集
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Datadog Real User Monitoring (RUM) を使用すると、アプリケーションの個々のユーザーのリアルタイムパフォーマンスとユーザージャーニーを視覚化して分析できます。
DDURLSessionDelegate
を初期化してデータ送信を開始します。注: Datadog iOS SDK に対応するバージョンは iOS v11 以降です。Datadog iOS SDK は、tvOS にも対応しています。
パッケージマネージャー | インストール方法 |
---|---|
CocoaPods | pod 'DatadogSDK' |
Swift Package Manager | .package(url: "https://github.com/DataDog/dd-sdk-ios.git", .upToNextMajor(from: "1.0.0")) |
Carthage | github "DataDog/dd-sdk-ios" |
アプリケーションタイプとして iOS
を選択し、新しいアプリケーション名を入力して一意の Datadog アプリケーション ID とクライアントトークンを生成します。
Web ビューをインスツルメントするには、Instrument your webviews トグルをクリックします。詳しくは、Web ビュー追跡を参照してください。
クライアント IP またはジオロケーションデータの自動ユーザーデータ収集を無効にするには、これらの設定のチェックボックスをオフにします。詳しくは、RUM iOS データ収集をご覧ください。
データの安全性を確保するため、クライアントトークンを使用する必要があります。dd-sdk-ios
ライブラリの構成に Datadog API キーのみを使用した場合、クライアント側で iOS アプリケーションのバイトコード内で公開されます。
クライアントトークンのセットアップについて、詳しくはクライアントトークンに関するドキュメントを参照してください。
初期化スニペットでは、環境名、サービス名、バージョン番号を設定します。以下の例では、app-name
がデータを生成するアプリケーションのバリアントを指定します。
詳しくは、タグの使用方法をご覧ください。
Datadog.initialize(
appContext: .init(),
trackingConsent: trackingConsent,
configuration: Datadog.Configuration
.builderUsing(
rumApplicationID: "<rum_application_id>",
clientToken: "<client_token>",
environment: "<environment_name>"
)
.set(serviceName: "app-name")
.set(endpoint: .us1)
.trackUIKitRUMViews()
.trackUIKitRUMActions()
.trackURLSession()
.build()
)
DDConfigurationBuilder *builder = [DDConfiguration builderWithRumApplicationID:@"<rum_application_id>"
clientToken:@"<client_token>"
environment:@"<environment_name>"];
[builder setWithServiceName:@"app-name"];
[builder setWithEndpoint:[DDEndpoint us1]];
[builder trackUIKitRUMViews];
[builder trackUIKitRUMActions];
[builder trackURLSessionWithFirstPartyHosts:[NSSet new]];
[DDDatadog initializeWithAppContext:[DDAppContext new]
trackingConsent:trackingConsent
configuration:[builder build]];
Datadog.initialize(
appContext: .init(),
trackingConsent: trackingConsent,
configuration: Datadog.Configuration
.builderUsing(
rumApplicationID: "<rum_application_id>",
clientToken: "<client_token>",
environment: "<environment_name>"
)
.set(serviceName: "app-name")
.set(endpoint: .eu1)
.trackUIKitRUMViews()
.trackUIKitRUMActions()
.trackURLSession()
.build()
)
DDConfigurationBuilder *builder = [DDConfiguration builderWithRumApplicationID:@"<rum_application_id>"
clientToken:@"<client_token>"
environment:@"<environment_name>"];
[builder setWithServiceName:@"app-name"];
[builder setWithEndpoint:[DDEndpoint eu1]];
[builder trackUIKitRUMViews];
[builder trackUIKitRUMActions];
[builder trackURLSessionWithFirstPartyHosts:[NSSet new]];
[DDDatadog initializeWithAppContext:[DDAppContext new]
trackingConsent:trackingConsent
configuration:[builder build]];
Datadog.initialize(
appContext: .init(),
trackingConsent: trackingConsent,
configuration: Datadog.Configuration
.builderUsing(
rumApplicationID: "<rum_application_id>",
clientToken: "<client_token>",
environment: "<environment_name>"
)
.set(serviceName: "app-name")
.set(endpoint: .us3)
.trackUIKitRUMViews()
.trackUIKitRUMActions()
.trackURLSession()
.build()
)
DDConfigurationBuilder *builder = [DDConfiguration builderWithRumApplicationID:@"<rum_application_id>"
clientToken:@"<client_token>"
environment:@"<environment_name>"];
[builder setWithServiceName:@"app-name"];
[builder setWithEndpoint:[DDEndpoint us3]];
[builder trackUIKitRUMViews];
[builder trackUIKitRUMActions];
[builder trackURLSessionWithFirstPartyHosts:[NSSet new]];
[DDDatadog initializeWithAppContext:[DDAppContext new]
trackingConsent:trackingConsent
configuration:[builder build]];
Datadog.initialize(
appContext: .init(),
trackingConsent: trackingConsent,
configuration: Datadog.Configuration
.builderUsing(
rumApplicationID: "<rum_application_id>",
clientToken: "<client_token>",
environment: "<environment_name>"
)
.set(serviceName: "app-name")
.set(endpoint: .us5)
.trackUIKitRUMViews()
.trackUIKitRUMActions()
.trackURLSession()
.build()
)
DDConfigurationBuilder *builder = [DDConfiguration builderWithRumApplicationID:@"<rum_application_id>"
clientToken:@"<client_token>"
environment:@"<environment_name>"];
[builder setWithServiceName:@"app-name"];
[builder setWithEndpoint:[DDEndpoint us5]];
[builder trackUIKitRUMViews];
[builder trackUIKitRUMActions];
[builder trackURLSessionWithFirstPartyHosts:[NSSet new]];
[DDDatadog initializeWithAppContext:[DDAppContext new]
trackingConsent:trackingConsent
configuration:[builder build]];
Datadog.initialize(
appContext: .init(),
trackingConsent: trackingConsent,
configuration: Datadog.Configuration
.builderUsing(
rumApplicationID: "<rum_application_id>",
clientToken: "<client_token>",
environment: "<environment_name>"
)
.set(serviceName: "app-name")
.set(endpoint: .us1_fed)
.trackUIKitRUMViews()
.trackUIKitRUMActions()
.trackURLSession()
.build()
)
DDConfigurationBuilder *builder = [DDConfiguration builderWithRumApplicationID:@"<rum_application_id>"
clientToken:@"<client_token>"
environment:@"<environment_name>"];
[builder setWithServiceName:@"app-name"];
[builder setWithEndpoint:[DDEndpoint us1_fed]];
[builder trackUIKitRUMViews];
[builder trackUIKitRUMActions];
[builder trackURLSessionWithFirstPartyHosts:[NSSet new]];
[DDDatadog initializeWithAppContext:[DDAppContext new]
trackingConsent:trackingConsent
configuration:[builder build]];
RUM iOS SDK は、SDK の初期化時に提供されたオプションに従いユーザーセッションを自動的に追跡します。EU ユーザーに対する GDPR コンプライアンスおよびその他の初期化パラメーターを SDK コンフィギュレーションに追加するには、トラッキングに関する同意の設定ドキュメントを参照してください。
DDURLSessionDelegate
の初期化RUM Monitor を構成して登録します。通常は AppDelegate
コードで、一度だけ実行する必要があります。
import Datadog
Global.rum = RUMMonitor.initialize()
@import DatadogObjc;
DDGlobal.rum = [[DDRUMMonitor alloc] init];
URLSession
インスタンスからリソースとして送信されるリクエストを監視するには、DDURLSessionDelegate()
をその URLSession
の delegate
として割り当てます。
let session = URLSession(
configuration: .default,
delegate: DDURLSessionDelegate(),
delegateQueue: nil
)
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]
delegate:[[DDNSURLSessionDelegate alloc] init]
delegateQueue:nil];
バックグラウンドイベントを追跡すると、セッションが追加され、課金に影響を与える可能性があります。ご質問は、Datadog サポートまでお問い合わせください。
アプリケーションがバックグラウンドにあるとき (例えば、アクティブなビューがないとき)、クラッシュやネットワークリクエストなどのイベントを追跡することができます。
Datadog の構成で、初期化時に以下のスニペットを追加します。
.trackBackgroundEvents()
iOS のクラッシュレポートとエラー追跡では、アプリケーションの問題と最新の利用可能なエラーが表示されます。エラーの詳細と JSON を含む属性を RUM エクスプローラーで表示できます。