This page lists integrated libraries you can use for Kotlin Multiplatform applications.
Ktor
If you use Ktor to make network requests in your application, you can integrate the Datadog Ktor plugin to collect RUM information about them:
- Install the Datadog Kotlin Multiplatform SDK and enable RUM.
- Add a common dependency to
dd-sdk-kotlin-multiplatform-ktorif you're using Ktor 2.x, ordd-sdk-kotlin-multiplatform-ktor3for Ktor 3.x:
kotlin {
// ...
sourceSets {
// ...
commonMain.dependencies {
// Use this line if you are using Ktor 2.x
implementation("com.datadoghq:dd-sdk-kotlin-multiplatform-ktor:x.x.x")
// Use this line if you are using Ktor 3.x
// implementation("com.datadoghq:dd-sdk-kotlin-multiplatform-ktor3:x.x.x")
}
}
}
- Add the provided
Datadog Ktor Pluginto your KtorHttpClient:
val ktorClient = HttpClient {
install(
datadogKtorPlugin(
tracedHosts = mapOf(
"example.com" to setOf(TracingHeaderType.DATADOG),
"example.eu" to setOf(TracingHeaderType.DATADOG)
),
traceSampleRate = 100f
)
)
}
Further reading
Additional helpful documentation, links, and articles: