Skip to content

Support transaction finishing automatically with 'idle timeout' #1074

@bruno-garcia

Description

@bruno-garcia

The idea is to have transactions that do not have a specified ending but a timeout instead. As if we had a mode for finishing transactions automatically once no new spans are added to it for N milliseconds, or a general timeout.

This would also be used by Unity, for example, when a scene loads. Potentially other UI frameworks like MAUI, WinForms, Uno, Avalonia and WPF. In all cases, user interaction can be a trigger. Without a specified end time, it runs until 'enough' has been tracked.

We need to define the spec in the develop.sentry.dev docs and align with other implementations of it. This is an approach used by the JS on the browser (and React Native). Similar behavior exists in different SDKs such as JavaScript and Android.

In terms of Span operation names, some have been defined already. For example, under Mobile here we see: ui.action.click which often rely on this behavior of completing based on a sliding expiration instead of a 'finish' call into the SDK.

Solution Brainstorm

This could be achieved by extending TransactionTracer with an optional parameter for the timeout. This should work independently of wait for children and simply trigger a finish after a set time period.

Other SDKs implementation of this:

Spec/SDK docs for this: https://develop.sentry.dev/sdk/performance/ui-event-transactions/

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions