Skip to content

Option to persist TraceId across the entire application session #2549

@vzlomvl

Description

@vzlomvl

What problem could Sentry solve that it doesn't?

With the recent changes in #2210, TraceId persistence was improved. However, the TraceId still appears to reset whenever a Transaction ends.

In Game Development, we often have distinct transactions (e.g., "Loading Screen", "Matchmaking", "Gameplay Loop"). If an error occurs during "Loading Screen" that causes a state corruption resulting in an error during "Gameplay Loop," it is difficult to link these events together because the TraceId has rotated.

Describe the solution you'd like
I would like an option in the Sentry Unity configuration to disable the automatic TraceId reset at the end of a Transaction.

Ideally, this would be a toggle like PersistTraceIdAcrossTransactions or SessionWideTracing. When enabled, the TraceId would remain constant from the moment the SDK initializes until the application process is terminated.

Describe alternatives you've considered
Currently, one might manually try to override the Scope or use tags to track a custom SessionId, but this doesn't leverage Sentry's native Tracing UI as effectively as a unified TraceId would.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions