- 필수 기능
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- 디지털 경험
- 소프트웨어 제공
- 보안
- 로그 관리
- 관리
- 인프라스트럭처
- ci
- containers
- csm
- ndm
- otel_guides
- overview
- slos
- synthetics
- tests
- 워크플로
2.0.0
or higher. See the Upgrade RUM Mobile SDKs guide.Follow this guide to use multiple named instances of the SDK. Many methods of the SDK optionally take an SDK instance as an argument. If none is provided, the call is associated with the default (nameless) SDK instance.
Note: The SDK instance name should be consistent between application runs. Storage paths for SDK events depend on this.
val namedSdkInstance = Datadog.initialize("myInstance", context, configuration, trackingConsent)
val userInfo = UserInfo(...)
Datadog.setUserInfo(userInfo, sdkCore = namedSdkInstance)
Logs.enable(logsConfig, namedSdkInstance)
val logger = Logger.Builder(namedSdkInstance)
...
.build()
Trace.enable(traceConfig, namedSdkInstance)
val tracer = AndroidTracer.Builder(namedSdkInstance)
...
.build()
Rum.enable(rumConfig, namedSdkInstance)
GlobalRumMonitor.get(namedSdkInstance)
NdkCrashReports.enable(namedSdkInstance)
WebViewTracking.enable(webView, allowedHosts, namedSdkInstance)
You can retrieve the named SDK instance by calling Datadog.getInstance(<name>)
and use the Datadog.isInitialized(<name>)
method to check if the particular SDK instance is initialized.
import DatadogCore
import DatadogRUM
import DatadogLogs
import DatadogTrace
let core = Datadog.initialize(
with: configuration,
trackingConsent: trackingConsent,
instanceName: "my-instance"
)
RUM.enable(
with: RUM.Configuration(applicationID: "<RUM Application ID>"),
in: core
)
Logs.enable(in: core)
Trace.enable(in: core)
Once the named SDK instance is initialized, you can retrieve it by calling Datadog.sdkInstance(named: "<name>")
and use it as shown below.
import DatadogCore
let core = Datadog.sdkInstance(named: "my-instance")
import DatadogLogs
let logger = Logger.create(in: core)
import DatadogRUM
let monitor = RUMMonitor.shared(in: core)
import DatadogRUM
let monitor = RUMMonitor.shared(in: core)
Additional helpful documentation, links, and articles: