Skip to content

Commit f8e95ec

Browse files
authored
feat: Add crons task consumers (#3106)
We now process tasks via Kafka consumers instead of celerybeat. This needs to be added to self-hosted as well
1 parent c40b153 commit f8e95ec

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,12 @@ services:
384384
ingest-monitors:
385385
<<: *sentry_defaults
386386
command: run consumer --no-strict-offset-reset ingest-monitors --consumer-group ingest-monitors
387+
monitors-clock-tick:
388+
<<: *sentry_defaults
389+
command: run consumer --no-strict-offset-reset monitors-clock-tick --consumer-group monitors-clock-tick
390+
monitors-clock-tasks:
391+
<<: *sentry_defaults
392+
command: run consumer --no-strict-offset-reset monitors-clock-tasks --consumer-group monitors-clock-tasks
387393
post-process-forwarder-errors:
388394
<<: *sentry_defaults
389395
command: run consumer post-process-forwarder-errors --consumer-group post-process-forwarder --synchronize-commit-log-topic=snuba-commit-log --synchronize-commit-group=snuba-consumers

install/create-kafka-topics.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,19 @@ done
1414

1515
# XXX(BYK): We cannot use auto.create.topics as Confluence and Apache hates it now (and makes it very hard to enable)
1616
EXISTING_KAFKA_TOPICS=$($dc exec -T kafka kafka-topics --list --bootstrap-server kafka:9092 2>/dev/null)
17-
NEEDED_KAFKA_TOPICS="ingest-attachments ingest-transactions ingest-events ingest-replay-recordings profiles ingest-occurrences ingest-metrics ingest-performance-metrics ingest-monitors"
17+
NEEDED_KAFKA_TOPICS="ingest-attachments ingest-transactions ingest-events ingest-replay-recordings profiles ingest-occurrences ingest-metrics ingest-performance-metrics ingest-monitors monitors-clock-tasks"
1818
for topic in $NEEDED_KAFKA_TOPICS; do
1919
if ! echo "$EXISTING_KAFKA_TOPICS" | grep -qE "(^| )$topic( |$)"; then
2020
$dc exec kafka kafka-topics --create --topic $topic --bootstrap-server kafka:9092
2121
echo ""
2222
fi
2323
done
2424

25+
# This topic must have only a single partition for the consumer to work correctly
26+
# https://github.com/getsentry/ops/blob/7dbc26f39c584ec924c8fef2ad5c532d6a158be3/k8s/clusters/us/_topicctl.yaml#L288-L295
27+
28+
if ! echo "$EXISTING_KAFKA_TOPICS" | grep -qE "(^| )monitors-clock-tick( |$)"; then
29+
$dc exec kafka kafka-topics --create --topic monitors-clock-tick --bootstrap-server kafka:9092 --partitions 1
30+
fi
31+
2532
echo "${_endgroup}"

0 commit comments

Comments
 (0)