From a476335cee9c94ee9a1e08b611dd9309ba7d7850 Mon Sep 17 00:00:00 2001 From: Edward Gou Date: Wed, 27 Nov 2024 11:33:56 -0500 Subject: [PATCH] Adds EAP spans results consumer configs --- src/sentry/conf/server.py | 1 + src/sentry/conf/types/kafka_definition.py | 1 + src/sentry/consumers/__init__.py | 6 ++++++ src/sentry/runner/commands/devserver.py | 1 + src/sentry/snuba/query_subscriptions/constants.py | 1 + tests/sentry/consumers/test_run.py | 1 + 6 files changed, 11 insertions(+) diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py index 82a9b2982cb7b9..c6ae1aa9a05422 100644 --- a/src/sentry/conf/server.py +++ b/src/sentry/conf/server.py @@ -2883,6 +2883,7 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]: "transactions-subscription-results": "default", "generic-metrics-subscription-results": "default", "metrics-subscription-results": "default", + "eap-spans-subscription-results": "default", "ingest-events": "default", "ingest-feedback-events": "default", "ingest-feedback-events-dlq": "default", diff --git a/src/sentry/conf/types/kafka_definition.py b/src/sentry/conf/types/kafka_definition.py index 710d365852999e..59ae1228343494 100644 --- a/src/sentry/conf/types/kafka_definition.py +++ b/src/sentry/conf/types/kafka_definition.py @@ -26,6 +26,7 @@ class Topic(Enum): TRANSACTIONS_SUBSCRIPTIONS_RESULTS = "transactions-subscription-results" GENERIC_METRICS_SUBSCRIPTIONS_RESULTS = "generic-metrics-subscription-results" METRICS_SUBSCRIPTIONS_RESULTS = "metrics-subscription-results" + EAP_SPANS_SUBSCRIPTIONS_RESULTS = "eap-spans-subscription-results" INGEST_EVENTS = "ingest-events" INGEST_EVENTS_DLQ = "ingest-events-dlq" INGEST_FEEDBACK_EVENTS = "ingest-feedback-events" diff --git a/src/sentry/consumers/__init__.py b/src/sentry/consumers/__init__.py index 02c31010a58a91..bb21f85fadb759 100644 --- a/src/sentry/consumers/__init__.py +++ b/src/sentry/consumers/__init__.py @@ -301,6 +301,12 @@ def ingest_transactions_options() -> list[click.Option]: "click_options": multiprocessing_options(default_max_batch_size=100), "static_args": {"dataset": "metrics"}, }, + "eap-spans-subscription-results": { + "topic": Topic.EAP_SPANS_SUBSCRIPTIONS_RESULTS, + "strategy_factory": "sentry.snuba.query_subscriptions.run.QuerySubscriptionStrategyFactory", + "click_options": multiprocessing_options(default_max_batch_size=100), + "static_args": {"dataset": "events_analytics_platform"}, + }, "ingest-events": { "topic": Topic.INGEST_EVENTS, "strategy_factory": "sentry.ingest.consumer.factory.IngestStrategyFactory", diff --git a/src/sentry/runner/commands/devserver.py b/src/sentry/runner/commands/devserver.py index 81c0986ebec41d..5a2b9a947a8f4a 100644 --- a/src/sentry/runner/commands/devserver.py +++ b/src/sentry/runner/commands/devserver.py @@ -37,6 +37,7 @@ "transactions-subscription-results", "generic-metrics-subscription-results", "metrics-subscription-results", + "eap-spans-subscription-results", ] diff --git a/src/sentry/snuba/query_subscriptions/constants.py b/src/sentry/snuba/query_subscriptions/constants.py index b04cf11f619fc6..f692db46d6d9c5 100644 --- a/src/sentry/snuba/query_subscriptions/constants.py +++ b/src/sentry/snuba/query_subscriptions/constants.py @@ -7,6 +7,7 @@ Dataset.Transactions: "transactions-subscription-results", Dataset.PerformanceMetrics: "generic-metrics-subscription-results", Dataset.Metrics: "metrics-subscription-results", + Dataset.EventsAnalyticsPlatform: "eap-spans-subscription-results", } topic_to_dataset = { diff --git a/tests/sentry/consumers/test_run.py b/tests/sentry/consumers/test_run.py index 9b48e119cf382f..18f6629c2225dd 100644 --- a/tests/sentry/consumers/test_run.py +++ b/tests/sentry/consumers/test_run.py @@ -31,6 +31,7 @@ def test_dlq(consumer_def) -> None: "transactions-subscription-results", "generic-metrics-subscription-results", "metrics-subscription-results", + "eap-spans-subscription-results", ] consumers_that_should_have_dlq_but_dont = [ "process-spans",