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:
parent
61a8d06a6a
commit
b4f1627748
3 changed files with 16 additions and 13 deletions
|
|
@ -25,7 +25,6 @@ import io.element.android.libraries.matrix.impl.room.preview.RoomPreviewInfoMapp
|
|||
import io.element.android.libraries.matrix.impl.roomlist.roomOrNull
|
||||
import io.element.android.services.analytics.api.AnalyticsLongRunningTransaction
|
||||
import io.element.android.services.analytics.api.AnalyticsService
|
||||
import io.element.android.services.analytics.api.inBridgeSdkSpan
|
||||
import io.element.android.services.analytics.api.recordTransaction
|
||||
import io.element.android.services.analyticsproviders.api.recordChildTransaction
|
||||
import io.element.android.services.toolbox.api.systemclock.SystemClock
|
||||
|
|
@ -128,19 +127,17 @@ class RustRoomFactory(
|
|||
val timeline = transaction.recordChildTransaction(
|
||||
operation = "sdkRoom.timelineWithConfiguration",
|
||||
description = "Get timeline from the SDK",
|
||||
) { timelineTransaction ->
|
||||
analyticsService.inBridgeSdkSpan(parentTraceId = timelineTransaction.traceId()) {
|
||||
sdkRoom.timelineWithConfiguration(
|
||||
TimelineConfiguration(
|
||||
focus = TimelineFocus.Live(hideThreadedEvents = hideThreadedEvents),
|
||||
filter = eventFilters?.let(TimelineFilter::EventFilter) ?: TimelineFilter.All,
|
||||
internalIdPrefix = "live",
|
||||
dateDividerMode = DateDividerMode.DAILY,
|
||||
trackReadReceipts = TimelineReadReceiptTracking.ALL_EVENTS,
|
||||
reportUtds = true,
|
||||
)
|
||||
) {
|
||||
sdkRoom.timelineWithConfiguration(
|
||||
TimelineConfiguration(
|
||||
focus = TimelineFocus.Live(hideThreadedEvents = hideThreadedEvents),
|
||||
filter = eventFilters?.let(TimelineFilter::EventFilter) ?: TimelineFilter.All,
|
||||
internalIdPrefix = "live",
|
||||
dateDividerMode = DateDividerMode.DAILY,
|
||||
trackReadReceipts = TimelineReadReceiptTracking.ALL_EVENTS,
|
||||
reportUtds = true,
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
GetRoomResult.Joined(
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue