mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Use secret Sentry DSN value (#4210)
* Use secret Sentry DSN value. We realised our DSN entry has been shipped along with the code and it was being used in several forks as is, resulting in wrong bug reports coming into our Sentry dashboard and making it very hard to debug actual issues in the app.
This commit is contained in:
committed by
GitHub
parent
55399798b6
commit
9b5b76203f
+12
-2
@@ -20,6 +20,7 @@ import io.element.android.libraries.di.ApplicationContext
|
||||
import io.element.android.services.analyticsproviders.api.AnalyticsProvider
|
||||
import io.element.android.services.analyticsproviders.sentry.log.analyticsTag
|
||||
import io.sentry.Sentry
|
||||
import io.sentry.SentryLevel
|
||||
import io.sentry.SentryOptions
|
||||
import io.sentry.android.core.SentryAndroid
|
||||
import timber.log.Timber
|
||||
@@ -35,13 +36,20 @@ class SentryAnalyticsProvider @Inject constructor(
|
||||
override fun init() {
|
||||
Timber.tag(analyticsTag.value).d("Initializing Sentry")
|
||||
if (Sentry.isEnabled()) return
|
||||
|
||||
val dsn = if (SentryConfig.DSN.isNotBlank()) {
|
||||
SentryConfig.DSN
|
||||
} else {
|
||||
Timber.w("No Sentry DSN provided, Sentry will not be initialized")
|
||||
return
|
||||
}
|
||||
|
||||
SentryAndroid.init(context) { options ->
|
||||
options.dsn = SentryConfig.DNS
|
||||
options.dsn = dsn
|
||||
options.beforeSend = SentryOptions.BeforeSendCallback { event, _ -> event }
|
||||
options.tracesSampleRate = 1.0
|
||||
options.isEnableUserInteractionTracing = true
|
||||
options.environment = buildMeta.buildType.toSentryEnv()
|
||||
options.diagnosticLevel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,9 +59,11 @@ class SentryAnalyticsProvider @Inject constructor(
|
||||
}
|
||||
|
||||
override fun capture(event: VectorAnalyticsEvent) {
|
||||
Sentry.captureMessage("Event: ${event.getName()}", SentryLevel.INFO)
|
||||
}
|
||||
|
||||
override fun screen(screen: VectorAnalyticsScreen) {
|
||||
Sentry.captureMessage("Screen: ${screen.getName()}", SentryLevel.INFO)
|
||||
}
|
||||
|
||||
override fun updateUserProperties(userProperties: UserProperties) {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ package io.element.android.services.analyticsproviders.sentry
|
||||
|
||||
object SentryConfig {
|
||||
const val NAME = "Sentry"
|
||||
const val DNS = "https://32f7ff6a6e724f90838b7654042b2e81@sentry.tools.element.io/59"
|
||||
const val DSN = BuildConfig.SENTRY_DSN
|
||||
const val ENV_DEBUG = "DEBUG"
|
||||
const val ENV_RELEASE = "RELEASE"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user