From 7610f32702d8d9b50056fc657b8473c60ae19cff Mon Sep 17 00:00:00 2001 From: Ox Cart Date: Mon, 25 Sep 2023 21:12:59 -0500 Subject: [PATCH] Added started action to Datadog RUM --- .../kotlin/org/getlantern/lantern/datadog/Datadog.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/kotlin/org/getlantern/lantern/datadog/Datadog.kt b/android/app/src/main/kotlin/org/getlantern/lantern/datadog/Datadog.kt index 2bb704a97..c98085d2f 100644 --- a/android/app/src/main/kotlin/org/getlantern/lantern/datadog/Datadog.kt +++ b/android/app/src/main/kotlin/org/getlantern/lantern/datadog/Datadog.kt @@ -25,6 +25,10 @@ object Datadog { listOf( "datadoghq.eu", "127.0.0.1", + "iantem.io", + "getlantern.org", + "getiantem.org", + "lantern.io", ) private val initialized = AtomicBoolean() private lateinit var datadogConfig: Configuration @@ -61,10 +65,14 @@ object Datadog { val session = LanternApp.getSession() setCountry(session.countryCode) initialized.set(true) + + // For some reason, sessions don't show up in DataDog RUM until we register a user action + // of some sort. So, here we fire the custom action "started" to get data to start flowing. + GlobalRum.get().addUserAction(RumActionType.CUSTOM, "started", emptyMap()) } fun setCountry(country: String) { - GlobalRum.addAttribute(GEO_COUNTRY_CODE, country) + GlobalRum.addAttribute("lantern.country_code", country) } fun addError( @@ -140,5 +148,4 @@ object Datadog { } private val TAG = Datadog::class.java.name - private const val GEO_COUNTRY_CODE = "lantern_country_code" }