Skip to content

Commit d8eb5f5

Browse files
authored
chore(span-buffer): Count and tag the amount of rebalancing (#94160)
We are debugging a consumer crash "broker handle destroyed" and are fishing for any correlation to pod lifetime or whether this happens during shutdown or startup.
1 parent b3f16d3 commit d8eb5f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sentry/spans/consumers/process/factory.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def __init__(
4646
):
4747
super().__init__()
4848

49+
self.rebalancing_count = 0
50+
4951
# config
5052
self.max_batch_size = max_batch_size
5153
self.max_batch_time = max_batch_time
@@ -63,6 +65,8 @@ def create_with_partitions(
6365
commit: Commit,
6466
partitions: Mapping[Partition, int],
6567
) -> ProcessingStrategy[KafkaPayload]:
68+
self.rebalancing_count += 1
69+
sentry_sdk.set_tag("sentry_spans_rebalancing_count", str(self.rebalancing_count))
6670
sentry_sdk.set_tag("sentry_spans_buffer_component", "consumer")
6771

6872
committer = CommitOffsets(commit)

0 commit comments

Comments
 (0)