You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
│ │ Error Store │ │ Check-in Store │ │ Log Store │ │
@@ -71,8 +71,8 @@ Introduce a `Buffer` layer between the `Client` and the `Transport`. This `Buffe
71
71
### Priorities
72
72
- CRITICAL: Error, Feedback.
73
73
- HIGH: Session, CheckIn.
74
-
- MEDIUM: Log, ClientReport, Span.
75
-
- LOW: Transaction, Profile, ProfileChunk.
74
+
- MEDIUM: Transaction, ClientReport, Span.
75
+
- LOW: Log, Profile, ProfileChunk.
76
76
- LOWEST: Replay.
77
77
78
78
Configurable via weights.
@@ -90,8 +90,8 @@ Each telemetry category maintains a store interface; a fixed-size circular array
90
90
-**Batching configuration**:
91
91
-`batchSize`: Number of items to combine into a single batch (1 for errors, transactions, and monitors; 100 for logs).
92
92
-`timeout`: Maximum time to wait before sending a partial batch (5 seconds for logs).
93
-
-**Bucketed Storage Support**: The storage interface should satisfy both bucketed and single-item implementations, allowing sending spans per trace id.
94
-
-**Observability**: Each store tracks offered, accepted, and dropped item counts for client reports.
93
+
-**Bucketed Storage Support**: The storage interface should satisfy both bucketed and single-item implementations, allowing sending spans per trace id (required for Span First).
94
+
-**Observability**: Each store tracks dropped item counts for client reports.
95
95
96
96
##### Single-item ring buffer (default)
97
97
@@ -104,15 +104,20 @@ Each telemetry category maintains a store interface; a fixed-size circular array
104
104
105
105
##### Bucketed-by-trace storage (spans)
106
106
107
-
- Purpose: keep spans from the same trace together and flush them as a unit to avoid partial-trace delivery under pressure.
108
-
- Grouping: a new bucket is created per trace id; a map (`traceIndex`) provides O(1) lookup. Items without a trace id are accepted but grouped without an index.
109
-
- Capacity model: two limits are enforced—overall `itemCapacity` and a derived `bucketCapacity ~= capacity/10` (minimum 10). Additionally, a `perBucketItemLimit` (100) prevents a single trace from monopolizing storage.
110
-
- Readiness: when total buffered items reach `batchSize` or `timeout` elapses, the entire oldest bucket is flushed to preserve trace coherence.
111
-
- Overflow behavior:
112
-
-`drop_oldest`: evict the oldest bucket (dropping all its items) and invoke the dropped callback for each (`buffer_full_drop_oldest_bucket`). Preferred for spans to drop an entire trace.
107
+
-**Purpose**: keep spans from the same trace together and flush them as a unit to avoid partial-trace delivery under pressure. This addresses a gap in standard implementations where individual span drops can create incomplete traces.
108
+
-**Grouping**: a new bucket is created per trace id; a map (`traceIndex`) provides O(1) lookup.
109
+
-**Capacity model**: two limits are enforced—overall `itemCapacity` and a derived `bucketCapacity ~= capacity/10` (minimum 10).
110
+
-**Readiness**: when total buffered items reach `batchSize` or `timeout` elapses, the entire oldest bucket is flushed to preserve trace coherence.
111
+
-**Overflow behavior**:
112
+
-`drop_oldest`: evict the oldest bucket (dropping all its items). Preferred for spans to drop an entire trace.
113
113
-`drop_newest`: reject the incoming item (`buffer_full_drop_newest`).
114
114
- Lifecycle: empty buckets are removed and their trace ids are purged from the index; `MarkFlushed()` updates `lastFlushTime`.
115
115
116
+
##### Trace Consistency Trade-offs
117
+
118
+
There still remains a small subset of cases that might result in partial traces, where either an old trace bucket was dropped and a new span with the same trace arrived, or we dropped an incoming span of this trace.
119
+
The preferred overflow behavior in most cases should be `drop_oldest` since it results in the fewest incomplete traces from the two scenarios.
120
+
116
121
Stores are mapped to [DataCategories](https://github.com/getsentry/relay/blob/master/relay-base-schema/src/data_category.rs), which determine their scheduling priority and rate limits.
117
122
118
123
#### Scheduler
@@ -135,18 +140,14 @@ The transport layer handles HTTP communication with Sentry's ingestion endpoints
135
140
### Configuration
136
141
137
142
#### Buffer Options
138
-
-**Capacity**: 100 items for errors, logs, and monitors; 1000 for transactions.
143
+
-**Capacity**: 100 items for errors and check-ins, 10*BATCH_SIZE for logs, 1000 for transactions.
139
144
-**Overflow policy**: `drop_oldest`.
140
145
-**Batch size**: 1 for errors and monitors (immediate send), 100 for logs.
0 commit comments