Skip to content

Commit 24a9f3d

Browse files
authored
feat(taskworker): Make ingest profiling taskworker compatible (#90293)
This work is required to migrate tasks from celery to the new taskbroker system. The sentry option will be used to control the rollout of these tasks. The full migration plan is describe in this [document](https://www.notion.so/sentry/Rollout-Planning-1bd8b10e4b5d80aeaaa7dba0efca83bc).
1 parent 7d68639 commit 24a9f3d

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

src/sentry/conf/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,7 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
14331433
"sentry.monitors.tasks.clock_pulse",
14341434
"sentry.monitors.tasks.detect_broken_monitor_envs",
14351435
"sentry.notifications.utils.tasks",
1436+
"sentry.profiles.task",
14361437
"sentry.release_health.tasks",
14371438
"sentry.relocation.tasks.process",
14381439
"sentry.relocation.tasks.transfer",
@@ -1471,13 +1472,12 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
14711472
"sentry.tasks.ping",
14721473
"sentry.tasks.process_buffer",
14731474
"sentry.tasks.release_registry",
1474-
"sentry.tasks.release_registry",
14751475
"sentry.tasks.repository",
14761476
"sentry.tasks.reprocessing2",
14771477
"sentry.tasks.statistical_detectors",
1478-
"sentry.tasks.summaries.weekly_reports",
1479-
"sentry.tasks.summaries.daily_summary",
14801478
"sentry.tasks.store",
1479+
"sentry.tasks.summaries.daily_summary",
1480+
"sentry.tasks.summaries.weekly_reports",
14811481
"sentry.tasks.symbolication",
14821482
"sentry.tasks.unmerge",
14831483
"sentry.tasks.update_user_reports",

src/sentry/options/defaults.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3366,6 +3366,11 @@
33663366
default={},
33673367
flags=FLAG_AUTOMATOR_MODIFIABLE,
33683368
)
3369+
register(
3370+
"taskworker.ingest.profiling.rollout",
3371+
default={},
3372+
flags=FLAG_AUTOMATOR_MODIFIABLE,
3373+
)
33693374
register(
33703375
"taskworker.telemetry-experience.rollout",
33713376
default={},

src/sentry/profiles/task.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
from sentry.signals import first_profile_received
3939
from sentry.silo.base import SiloMode
4040
from sentry.tasks.base import instrumented_task
41+
from sentry.taskworker.config import TaskworkerConfig
42+
from sentry.taskworker.namespaces import ingest_profiling_tasks
43+
from sentry.taskworker.retry import Retry
4144
from sentry.utils import json, metrics
4245
from sentry.utils.arroyo_producer import SingletonProducer
4346
from sentry.utils.kafka_config import get_kafka_producer_cluster_options, get_topic_definition
@@ -88,6 +91,11 @@ def _get_profiles_producer_from_topic(topic: Topic) -> KafkaProducer:
8891
task_time_limit=60,
8992
task_acks_on_failure_or_timeout=False,
9093
silo_mode=SiloMode.REGION,
94+
taskworker_config=TaskworkerConfig(
95+
namespace=ingest_profiling_tasks,
96+
processing_deadline_duration=60,
97+
retry=Retry(times=2),
98+
),
9199
)
92100
def process_profile_task(
93101
profile: Profile | None = None,

src/sentry/taskworker/namespaces.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
hybridcloud_control_tasks = taskregistry.create_namespace("hybridcloud.control")
3636

37+
ingest_profiling_tasks = taskregistry.create_namespace("ingest.profiling")
38+
3739
issues_tasks = taskregistry.create_namespace("issues")
3840

3941
integrations_tasks = taskregistry.create_namespace("integrations")

0 commit comments

Comments
 (0)