From 3f7e560cef01482f001065354288107caf9c80cf Mon Sep 17 00:00:00 2001 From: Andrew Liu <159852527+aliu3ntry@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:06:38 -0700 Subject: [PATCH] feat(feedback): use ConsumerType in consumer defns + rename feedback c.type (#67404) --- src/sentry/consumers/__init__.py | 9 +++++---- src/sentry/ingest/types.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sentry/consumers/__init__.py b/src/sentry/consumers/__init__.py index a7eca3fe23ece..b5839fee68ecb 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 from sentry.utils.imports import import_string from sentry.utils.kafka_config import get_kafka_producer_cluster_options, get_topic_definition @@ -257,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, }, @@ -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": ConsumerType.Feedback, }, "dlq_topic": Topic.INGEST_FEEDBACK_EVENTS_DLQ, }, @@ -275,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, }, "dlq_topic": Topic.INGEST_ATTACHMENTS_DLQ, }, @@ -284,7 +285,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, }, "dlq_topic": Topic.INGEST_TRANSACTIONS_DLQ, }, 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)