Skip to content

Commit aa11124

Browse files
authored
ref(items): Force a random routing key instead of letting Kafka handle it (#4974)
We notice partitions not having equal load, especially when Relay sees a spike in items (maybe it's scaling up, maybe it's Monday morning). We'd like to try this to see if we can improve randomizing our items to every partitions.
1 parent 072c108 commit aa11124

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- Disable span metrics. ([#4931](https://github.com/getsentry/relay/pull/4931),[#4955](https://github.com/getsentry/relay/pull/4955))
1414
- Deprecate old AI monitoring attributes. ([#4960](https://github.com/getsentry/relay/pull/4960))
1515
- Normalize legacy `ai.*` attributes to `gen_ai.*` names. ([#4924](https://github.com/getsentry/relay/pull/4924))
16+
- Force the routing key to be random instead of letting Kafka handle the randomization. ([#4974](https://github.com/getsentry/relay/pull/4974))
1617

1718
## 25.7.0
1819

relay-server/src/services/store.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,13 +2046,10 @@ impl Message for KafkaMessage<'_> {
20462046
// This results in significantly more work for Kafka, but we've seen that the metrics
20472047
// indexer consumer in Sentry, cannot deal with this load shape.
20482048
// Until the metric indexer is updated, we still need to assign random keys here.
2049-
Self::Metric { .. } => Some(Uuid::new_v4()),
2049+
Self::Metric { .. } | Self::Item { .. } => Some(Uuid::new_v4()),
20502050

20512051
// Random partitioning
2052-
Self::Profile(_)
2053-
| Self::ReplayRecordingNotChunked(_)
2054-
| Self::ProfileChunk(_)
2055-
| Self::Item { .. } => None,
2052+
Self::Profile(_) | Self::ReplayRecordingNotChunked(_) | Self::ProfileChunk(_) => None,
20562053
}
20572054
.filter(|uuid| !uuid.is_nil())
20582055
.map(|uuid| uuid.into_bytes())

0 commit comments

Comments
 (0)