Adjust metrics to the new specifications (#5937)
* Add `AnalyticsTransactions` with a set of `TransactionDefinition` items matching those in the user story * Use that for `AnalyticsLongRunningTransactions`, make sure we send the right fields (name, operation, description) * Add `AnalyticsSendMessageWatcher` to track how long it takes for an event to be sent and for us to get a call back for that from sync * Add `Noop` implementation for enterprise
This commit is contained in:
parent
bc62d4c8ba
commit
71031008dd
33 changed files with 443 additions and 48 deletions
|
|
@ -112,8 +112,8 @@ class SentryAnalyticsProvider(
|
|||
Sentry.captureException(throwable)
|
||||
}
|
||||
|
||||
override fun startTransaction(name: String, operation: String?): AnalyticsTransaction? {
|
||||
return SentryAnalyticsTransaction(name, operation)
|
||||
override fun startTransaction(name: String, operation: String?, description: String?): AnalyticsTransaction? {
|
||||
return SentryAnalyticsTransaction(name, operation, description)
|
||||
}
|
||||
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ import io.sentry.Sentry
|
|||
import timber.log.Timber
|
||||
|
||||
class SentryAnalyticsTransaction private constructor(span: ISpan) : AnalyticsTransaction {
|
||||
constructor(name: String, operation: String?) : this(Sentry.startTransaction(name, operation.orEmpty()))
|
||||
constructor(name: String, operation: String?, description: String? = null) : this(
|
||||
Sentry.startTransaction(name, operation.orEmpty()).also { it.description = description }
|
||||
)
|
||||
private val inner = span
|
||||
|
||||
override fun startChild(operation: String, description: String?): AnalyticsTransaction = SentryAnalyticsTransaction(
|
||||
|
|
@ -30,7 +32,7 @@ class SentryAnalyticsTransaction private constructor(span: ISpan) : AnalyticsTra
|
|||
}
|
||||
override fun finish() {
|
||||
val name = if (inner is ITransaction) inner.name else inner.operation
|
||||
Timber.d("Finishing transaction: $name")
|
||||
Timber.d("Finishing transaction: '$name'")
|
||||
inner.finish()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue