From 94d3e3fc02b1c68c9052dec1c9163cfa0a671204 Mon Sep 17 00:00:00 2001 From: Andrew Liu Date: Wed, 20 Mar 2024 16:45:53 -0700 Subject: [PATCH 1/4] feat(feedback): rename/simplify consumer_type for feedback topic --- src/sentry/consumers/__init__.py | 3 ++- src/sentry/ingest/consumer/simple_event.py | 2 +- src/sentry/ingest/types.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sentry/consumers/__init__.py b/src/sentry/consumers/__init__.py index ffdeb801d764e..1685f99d05a8f 100644 --- a/src/sentry/consumers/__init__.py +++ b/src/sentry/consumers/__init__.py @@ -23,6 +23,7 @@ validate_consumer_definition, ) from sentry.consumers.validate_schema import ValidateSchema +from sentry.ingest.types import ConsumerType as IngestConsumerType from sentry.utils.imports import import_string from sentry.utils.kafka_config import get_kafka_producer_cluster_options, get_topic_definition @@ -266,7 +267,7 @@ def ingest_events_options() -> list[click.Option]: "strategy_factory": "sentry.ingest.consumer.factory.IngestStrategyFactory", "click_options": ingest_events_options(), "static_args": { - "consumer_type": "feedback-events", + "consumer_type": IngestConsumerType.Feedback, }, "dlq_topic": Topic.INGEST_FEEDBACK_EVENTS_DLQ, }, diff --git a/src/sentry/ingest/consumer/simple_event.py b/src/sentry/ingest/consumer/simple_event.py index 07b09863a7552..a6c305eb19058 100644 --- a/src/sentry/ingest/consumer/simple_event.py +++ b/src/sentry/ingest/consumer/simple_event.py @@ -18,7 +18,7 @@ "events": Topic.INGEST_EVENTS, "transactions": Topic.INGEST_TRANSACTIONS, "attachments": Topic.INGEST_ATTACHMENTS, - "ingest-feedback-events": Topic.INGEST_FEEDBACK_EVENTS, + "feedback": Topic.INGEST_FEEDBACK_EVENTS, } diff --git a/src/sentry/ingest/types.py b/src/sentry/ingest/types.py index 5fb66c5df008e..d9ca4198dbc01 100644 --- a/src/sentry/ingest/types.py +++ b/src/sentry/ingest/types.py @@ -6,4 +6,4 @@ class ConsumerType: Events = "events" # consumes simple events ( from the Events topic) Attachments = "attachments" # consumes events with attachments ( from the Attachments topic) Transactions = "transactions" # consumes transaction events ( from the Transactions topic) - FeedbackEvents = "feedback-events" # consumes user feedback events ( from the Feedbacks topic) + Feedback = "feedback" # consumes user feedback ( from the ingest-feedback-events topic) From 2b19aecfa6e86bcd702398456065eeadbe693404 Mon Sep 17 00:00:00 2001 From: Andrew Liu Date: Wed, 20 Mar 2024 16:51:48 -0700 Subject: [PATCH 2/4] undo changes to simple_event to avoid merge conflict with 67349 --- src/sentry/ingest/consumer/simple_event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/ingest/consumer/simple_event.py b/src/sentry/ingest/consumer/simple_event.py index a6c305eb19058..07b09863a7552 100644 --- a/src/sentry/ingest/consumer/simple_event.py +++ b/src/sentry/ingest/consumer/simple_event.py @@ -18,7 +18,7 @@ "events": Topic.INGEST_EVENTS, "transactions": Topic.INGEST_TRANSACTIONS, "attachments": Topic.INGEST_ATTACHMENTS, - "feedback": Topic.INGEST_FEEDBACK_EVENTS, + "ingest-feedback-events": Topic.INGEST_FEEDBACK_EVENTS, } From 6f5c2e62ff36b647d418cbb218182c7e79f84a5d Mon Sep 17 00:00:00 2001 From: Andrew Liu Date: Thu, 21 Mar 2024 09:43:01 -0700 Subject: [PATCH 3/4] rm ingestconsumer alias --- src/sentry/consumers/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sentry/consumers/__init__.py b/src/sentry/consumers/__init__.py index 8ac1bba607727..dbc33e7564985 100644 --- a/src/sentry/consumers/__init__.py +++ b/src/sentry/consumers/__init__.py @@ -23,7 +23,7 @@ validate_consumer_definition, ) from sentry.consumers.validate_schema import ValidateSchema -from sentry.ingest.types import ConsumerType as IngestConsumerType +from sentry.ingest.types import ConsumerType from sentry.utils.imports import import_string from sentry.utils.kafka_config import get_kafka_producer_cluster_options, get_topic_definition @@ -267,7 +267,7 @@ def ingest_events_options() -> list[click.Option]: "strategy_factory": "sentry.ingest.consumer.factory.IngestStrategyFactory", "click_options": ingest_events_options(), "static_args": { - "consumer_type": IngestConsumerType.Feedback, + "consumer_type": ConsumerType.Feedback, }, "dlq_topic": Topic.INGEST_FEEDBACK_EVENTS_DLQ, }, From 438f0b82221111ba4df0a82c154f12d6cac35370 Mon Sep 17 00:00:00 2001 From: Andrew Liu Date: Thu, 21 Mar 2024 09:44:44 -0700 Subject: [PATCH 4/4] use ConsumerType for events, attach., txns --- src/sentry/consumers/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sentry/consumers/__init__.py b/src/sentry/consumers/__init__.py index dbc33e7564985..9bb4df48b9121 100644 --- a/src/sentry/consumers/__init__.py +++ b/src/sentry/consumers/__init__.py @@ -258,7 +258,7 @@ def ingest_events_options() -> list[click.Option]: "strategy_factory": "sentry.ingest.consumer.factory.IngestStrategyFactory", "click_options": ingest_events_options(), "static_args": { - "consumer_type": "events", + "consumer_type": ConsumerType.Events, }, "dlq_topic": Topic.INGEST_EVENTS_DLQ, }, @@ -276,7 +276,7 @@ def ingest_events_options() -> list[click.Option]: "strategy_factory": "sentry.ingest.consumer.factory.IngestStrategyFactory", "click_options": ingest_events_options(), "static_args": { - "consumer_type": "attachments", + "consumer_type": ConsumerType.Attachments, }, }, "ingest-transactions": { @@ -284,7 +284,7 @@ def ingest_events_options() -> list[click.Option]: "strategy_factory": "sentry.ingest.consumer.factory.IngestStrategyFactory", "click_options": ingest_events_options(), "static_args": { - "consumer_type": "transactions", + "consumer_type": ConsumerType.Transactions, }, }, "ingest-metrics": {