Skip to content

Commit

Permalink
feat: Switch default transactions topic (#39988)
Browse files Browse the repository at this point in the history
Should be (roughly) synchronized with equivalent change in Snuba
(getsentry/snuba#3250)

This would only affect self hosted and dev users who are using the Kafka
backend. All Sentry prod envivonments have already been migrated via
other methods to ensure zero downtime during the transition.
  • Loading branch information
lynnagara authored and barkbarkimashark committed Oct 18, 2022
1 parent c63ad5e commit f095fde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2468,11 +2468,7 @@ def build_cdc_postgres_init_db_volume(settings):
# pick up the change.

KAFKA_EVENTS = "events"
# TODO: KAFKA_TRANSACTIONS is temporarily mapped to "events" since events
# transactions curently share a Kafka topic. Once we are ready with the code
# changes to support different topic, switch this to "transactions" to start
# producing to the new topic.
KAFKA_TRANSACTIONS = "events"
KAFKA_TRANSACTIONS = "transactions"
KAFKA_OUTCOMES = "outcomes"
KAFKA_OUTCOMES_BILLING = "outcomes-billing"
KAFKA_EVENTS_SUBSCRIPTIONS_RESULTS = "events-subscription-results"
Expand Down
3 changes: 2 additions & 1 deletion tests/sentry/eventstream/test_eventstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ def __produce_event(self, *insert_args, **insert_kwargs):

produce_args, produce_kwargs = list(producer.produce.call_args)
assert not produce_args
assert produce_kwargs["topic"] == settings.KAFKA_EVENTS
if is_transaction_event:
assert produce_kwargs["topic"] == settings.KAFKA_TRANSACTIONS
assert produce_kwargs["key"] is None
else:
assert produce_kwargs["topic"] == settings.KAFKA_EVENTS
assert produce_kwargs["key"] == str(self.project.id).encode("utf-8")

version, type_, payload1, payload2 = json.loads(produce_kwargs["value"])
Expand Down

0 comments on commit f095fde

Please sign in to comment.