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

REPLAY-1894: Remove explicit dependency on RUM module from Session Replay #1541

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
1 change: 0 additions & 1 deletion features/dd-sdk-android-session-replay/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ android {

dependencies {
api(project(":dd-sdk-android-core"))
api(project(":features:dd-sdk-android-rum"))
implementation(libs.okHttp)
implementation(libs.kotlin)
implementation(libs.gson)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package com.datadog.android.sessionreplay.internal.domain
import com.datadog.android.api.context.DatadogContext
import com.datadog.android.api.net.Request
import com.datadog.android.api.net.RequestFactory
import com.datadog.android.rum.RumAttributes
import com.datadog.android.sessionreplay.internal.exception.InvalidPayloadFormatException
import com.datadog.android.sessionreplay.internal.net.BatchesToSegmentsMapper
import okhttp3.RequestBody
Expand Down Expand Up @@ -45,14 +44,13 @@ internal class SessionReplayRequestFactory(

private fun tags(datadogContext: DatadogContext): String {
val elements = mutableListOf(
"${RumAttributes.SERVICE_NAME}:${datadogContext.service}",
"${RumAttributes.APPLICATION_VERSION}:" +
datadogContext.version,
"${RumAttributes.SDK_VERSION}:${datadogContext.sdkVersion}",
"${RumAttributes.ENV}:${datadogContext.env}"
"$SERVICE_NAME:${datadogContext.service}",
"$APPLICATION_VERSION:${datadogContext.version}",
"$SDK_VERSION:${datadogContext.sdkVersion}",
"$ENV:${datadogContext.env}"
)
if (datadogContext.variant.isNotEmpty()) {
elements.add("${RumAttributes.VARIANT}:${datadogContext.variant}")
elements.add("$VARIANT:${datadogContext.variant}")
}
return elements.joinToString(",")
}
Expand Down Expand Up @@ -115,5 +113,10 @@ internal class SessionReplayRequestFactory(

companion object {
private const val UPLOAD_URL = "%s/api/v2/%s"
internal const val APPLICATION_VERSION = "version"
internal const val ENV = "env"
internal const val SERVICE_NAME = "service"
internal const val VARIANT = "variant"
internal const val SDK_VERSION = "sdk_version"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package com.datadog.android.sessionreplay.internal.domain

import com.datadog.android.api.context.DatadogContext
import com.datadog.android.api.net.RequestFactory
import com.datadog.android.rum.RumAttributes
import com.datadog.android.sessionreplay.forge.ForgeConfigurator
import com.datadog.android.sessionreplay.internal.exception.InvalidPayloadFormatException
import com.datadog.android.sessionreplay.internal.net.BatchesToSegmentsMapper
Expand Down Expand Up @@ -178,14 +177,14 @@ internal class SessionReplayRequestFactoryTest {

private fun expectedUrl(endpointUrl: String): String {
val queryTags = mutableListOf(
"${RumAttributes.SERVICE_NAME}:${fakeDatadogContext.service}",
"${RumAttributes.APPLICATION_VERSION}:${fakeDatadogContext.version}",
"${RumAttributes.SDK_VERSION}:${fakeDatadogContext.sdkVersion}",
"${RumAttributes.ENV}:${fakeDatadogContext.env}"
"${SessionReplayRequestFactory.SERVICE_NAME}:${fakeDatadogContext.service}",
"${SessionReplayRequestFactory.APPLICATION_VERSION}:${fakeDatadogContext.version}",
"${SessionReplayRequestFactory.SDK_VERSION}:${fakeDatadogContext.sdkVersion}",
"${SessionReplayRequestFactory.ENV}:${fakeDatadogContext.env}"
)

if (fakeDatadogContext.variant.isNotEmpty()) {
queryTags.add("${RumAttributes.VARIANT}:${fakeDatadogContext.variant}")
queryTags.add("${SessionReplayRequestFactory.VARIANT}:${fakeDatadogContext.variant}")
}

return "$endpointUrl/api/v2/replay?${RequestFactory.QUERY_PARAM_SOURCE}=" +
Expand Down
4 changes: 3 additions & 1 deletion sample/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ android {
dependencies {

implementation(project(":dd-sdk-android-core"))
implementation(project(":features:dd-sdk-android-ndk"))
implementation(project(":features:dd-sdk-android-logs"))
implementation(project(":features:dd-sdk-android-rum"))
implementation(project(":features:dd-sdk-android-trace"))
implementation(project(":features:dd-sdk-android-ndk"))
implementation(project(":features:dd-sdk-android-webview"))
implementation(project(":features:dd-sdk-android-session-replay"))
implementation(project(":features:dd-sdk-android-session-replay-material"))
Expand Down