Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve event debouncing and throtteling #2004

Open
bitsandfoxes opened this issue Feb 3, 2025 · 0 comments
Open

Improve event debouncing and throtteling #2004

bitsandfoxes opened this issue Feb 3, 2025 · 0 comments

Comments

@bitsandfoxes
Copy link
Contributor

Goal

The goal is to provide more granular control over event debouncing. Particularly, for high-frequency events like those from Update() functions. This allows users to preserve quota while keeping error reporting intact.

Current Problem

  1. Events from Update() functions that run every frame can quickly consume error reporting quotas
  2. Current debouncing is not flexible enough for different types of events.
    i.e. There's not debouncing for exceptions
  3. Existing workarounds in BeforeSend (stack trace checking + random sampling) are hacky and might miss important errors

Current Implementation

We're using the following debouncer https://github.com/getsentry/sentry-unity/blob/main/src/Sentry.Unity/TimeDebounceBase.cs

in the Application Logging Integration

if (_options?.EnableLogDebouncing is true)
{
var debounced = logType switch
{
LogType.Error or LogType.Assert => _errorTimeDebounce?.Debounced(),
LogType.Log => _logTimeDebounce?.Debounced(),
LogType.Warning => _warningTimeDebounce?.Debounced(),
_ => true
};
if (debounced is not true)
{
return;
}
}

Proposal

Implement configurable debouncing that allows:

  • Event based debouncing options: error, exception
  • Different debouncing intervals for different event types?
  • Deduplication detection
    • Can the stacktrace be used?
    • Can we leverage exception.HResult? Maybe in combination with the stacktrace?

Additional Consideration

The .NET SDK has its own debouncer now (for memory dumps). Can this be reused?

The Godot SDK has event throtteling implemented as part of its logging intgration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant