Remove distributed tracing of the 'timeline loading' flow (#6644)

* Remove distributed tracing of the 'timeline loading' flow. This is causing crashes in the app when a debug SDK build is used

* Discourage using the APIs related with distributed tracing, explaining the problem
This commit is contained in:
Jorge Martin Espinosa
2026-04-22 17:51:51 +02:00
committed by GitHub
parent 61a8d06a6a
commit b4f1627748
3 changed files with 16 additions and 13 deletions
@@ -7,9 +7,12 @@
package io.element.android.services.analytics.api
import androidx.annotation.Discouraged
/**
* Represents an analytics span in the Rust SDK.
*/
@Discouraged("This component can cause crashes of the app when using debug builds of the Rust SDK.")
interface AnalyticsSdkSpan {
/** Enters the span and starts collecting metrics. */
fun enter()
@@ -8,6 +8,7 @@
package io.element.android.services.analytics.api
import androidx.annotation.Discouraged
import io.element.android.services.analyticsproviders.api.AnalyticsProvider
import io.element.android.services.analyticsproviders.api.AnalyticsTransaction
import io.element.android.services.analyticsproviders.api.trackers.AnalyticsTracker
@@ -74,6 +75,7 @@ interface AnalyticsService : AnalyticsTracker, ErrorTracker {
fun removeLongRunningTransaction(longRunningTransaction: AnalyticsLongRunningTransaction): AnalyticsTransaction?
/** Enter a span inside the Rust SDK tracing system. If a [parentTraceId] is provided, the SDK trace will be added as a child of that trace. */
@Discouraged("This method can cause crashes of the app when using debug builds of the Rust SDK.")
fun enterSdkSpan(name: String?, parentTraceId: String?): AnalyticsSdkSpan
}
@@ -116,6 +118,7 @@ fun AnalyticsService.finishLongRunningTransaction(
} ?: false
}
@Discouraged("This method can cause crashes of the app when using debug builds of the Rust SDK.")
inline fun <T> AnalyticsService.inBridgeSdkSpan(parentTraceId: String?, block: (AnalyticsSdkSpan) -> T): T {
val span = enterSdkSpan(name = null, parentTraceId = parentTraceId)
return try {