Skip to content

Replace hardcoded event limit with configurable disk usage limit #2443

@abhaysood

Description

@abhaysood

Problem

Currently, we hardcode the maximum number of stored events to 50,000. When this limit is exceeded, we delete all events from the oldest session. This approach has limitations:

  • Event sizes vary significantly, making a fixed count an imprecise storage measure.
  • Developers cannot adjust storage limits based on their application's needs.
  • 50K events is too large a limit.

Proposed Solution

Replace the hardcoded event count with a configurable disk usage limit measured in MB.

Storage Estimation Formula

We'll estimate disk usage using these average sizes:

Standard event: 4KB
Layout snapshot: 10KB
Overall average per event: 15KB (accounts for exception events, screenshots, SQLite indexes, and metadata overhead)

Configuration Options

Default limit: 50MB (~5000 events at 10KB average)
Allowed configurable range: 20MB - 1500MB

Metadata

Metadata

Assignees

Labels

androidandroid relatedfeaturenew featuresflutterflutter related

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions