Do not report TTFD span with DEADLINE_EXCEEDED status
Problem Statement
Hi!
We started reporting TTFD for one of our screens, and we noticed that the SDK also attaches the TTFD span to all other screens with DEADLINE_EXCEEDED status. Since our pricing now depends on span count, it would be better not to attach it to all transactions, because implementing the TTFD reporting for every screen requires additional development.
I think that we can fix it on our side with a custom EventProcessor that will remove such spans, but please consider improving it on the SDK's side.
Thank you!
Solution Brainstorm
No response
@zhukic thanks for the valuable feedback, this makes a lot of sense! We'll discuss this internally and keep you posted.
Hi @zhukic
In the meantime you can filter them out using the beforeSend, like so:
SentryAndroid.init(context) { options ->
...
options.beforeSendTransaction = SentryOptions.BeforeSendTransactionCallback { transaction, hint ->
// "MainActivity" is the class name of the Activity that should keep the TTFD span
if (transaction.transaction != "MainActivity") {
transaction.spans.removeAll { it.op == "ui.load.full_display" }
}
transaction
}
}
Please, let us know if this works for you
@stefanosiano it works, thank you!