Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3762043
D2881.id7340.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D2881.id7340.diff
View Options
diff --git a/pillar/paas/docker/docker-002/sentry.sls b/pillar/paas/docker/docker-002/sentry.sls
--- a/pillar/paas/docker/docker-002/sentry.sls
+++ b/pillar/paas/docker/docker-002/sentry.sls
@@ -14,6 +14,7 @@
- library/postgres
- library/redis:3.2-alpine
- library/sentry
+ - getsentry/snuba:nightly
- tianon/exim4
- yandex/clickhouse-server:20.3.9.70
@@ -72,7 +73,75 @@
max_memory_ratio: 0.2
#
- # Services maintained by Sentry
+ # Snuba
+ #
+
+ snuba_api:
+ sentry_snuba_api:
+ network: sentry
+ services: &sentry_snuba_services
+ broker: sentry_kafka:9092
+ clickhouse: sentry_clickhouse
+ redis: sentry_redis
+
+ snuba:
+ sentry_snuba_consumer:
+ command: consumer --storage errors --auto-offset-reset=latest --max-batch-time-ms 750
+ network: sentry
+ services: *sentry_snuba_services
+
+ sentry_snuba_outcomes_consumer:
+ command: consumer --storage outcomes_raw --auto-offset-reset=earliest --max-batch-time-ms 750
+ network: sentry
+ services: *sentry_snuba_services
+
+ sentry_snuba_replacer:
+ command: replacer --storage errors --auto-offset-reset=latest
+ network: sentry
+ services: *sentry_snuba_services
+
+ sentry_snuba_replays_consumer:
+ command: consumer --storage replays --auto-offset-reset=latest --max-batch-time-ms 750
+ network: sentry
+ services: *sentry_snuba_services
+
+ sentry_snuba_sessions_consumer:
+ command: consumer --storage sessions_raw --auto-offset-reset=latest --max-batch-time-ms 750
+ network: sentry
+ services: *sentry_snuba_services
+
+ sentry_snuba_subscription_consumer_events:
+ command: subscriptions-scheduler-executor --dataset events --entity events --auto-offset-reset=latest
+ --no-strict-offset-reset --consumer-group=snuba-events-subscriptions-consumers
+ --followed-consumer-group=snuba-consumers --delay-seconds=60 --schedule-ttl=60
+ --stale-threshold-seconds=900
+ network: sentry
+ services: *sentry_snuba_services
+
+ sentry_snuba_subscription_consumer_sessions:
+ command: subscriptions-scheduler-executor --dataset sessions --entity sessions
+ --auto-offset-reset=latest --no-strict-offset-reset --consumer-group=snuba-sessions-subscriptions-consumers
+ --followed-consumer-group=sessions-group --delay-seconds=60 --schedule-ttl=60
+ --stale-threshold-seconds=900
+ network: sentry
+ services: *sentry_snuba_services
+
+ sentry_snuba_subscription_consumer_transactions:
+ command: subscriptions-scheduler-executor --dataset transactions --entity transactions
+ --auto-offset-reset=latest --no-strict-offset-reset --consumer-group=snuba-transactions-subscriptions-consumers
+ --followed-consumer-group=transactions_group --delay-seconds=60 --schedule-ttl=60
+ --stale-threshold-seconds=900
+ network: sentry
+ services: *sentry_snuba_services
+
+ sentry_snuba_transactions_consumer:
+ command: consumer --storage transactions --consumer-group transactions_group
+ --auto-offset-reset=latest --max-batch-time-ms 750
+ network: sentry
+ services: *sentry_snuba_services
+
+ #
+ # Sentry
#
sentry:
diff --git a/roles/paas-docker/containers/snuba.sls b/roles/paas-docker/containers/snuba.sls
new file mode 100644
--- /dev/null
+++ b/roles/paas-docker/containers/snuba.sls
@@ -0,0 +1,31 @@
+# -------------------------------------------------------------
+# Salt — Provision Docker engine
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Notes: Environment follows getsentry/self-hosted
+# -------------------------------------------------------------
+
+{% for instance, container in pillar['docker_containers']['snuba'].items() %}
+
+{{ instance }}:
+ docker_container.running:
+ - detach: True
+ - interactive: True
+ - image: getsentry/snuba:nightly
+ - command: {{ container["command"] }}
+ - environment:
+ SNUBA_SETTINGS: docker
+ CLICKHOUSE_HOST: {{ container["services"]["clickhouse"] }}
+ DEFAULT_BROKERS: {{ container["services"]["broker"] }}
+ REDIS_HOST: {{ container["services"]["redis"] }}
+ UWSGI_MAX_REQUESTS: 10000
+ UWSGI_DISABLE_LOGGING: "true"
+
+ # Leaving the value empty to just pass whatever is set
+ # on the host system (or in the .env file)
+ SENTRY_EVENT_RETENTION_DAYS:
+ - networks:
+ - {{ container["network"] }}
+
+{% endfor %}
diff --git a/roles/paas-docker/containers/snuba_api.sls b/roles/paas-docker/containers/snuba_api.sls
new file mode 100644
--- /dev/null
+++ b/roles/paas-docker/containers/snuba_api.sls
@@ -0,0 +1,44 @@
+# -------------------------------------------------------------
+# Salt — Provision Docker engine
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Notes: Environment follows getsentry/self-hosted
+# -------------------------------------------------------------
+
+{% for instance, container in pillar['docker_containers']['snuba_api'].items() %}
+
+# -------------------------------------------------------------
+# Container
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ instance }}:
+ docker_container.running:
+ - detach: True
+ - interactive: True
+ - image: getsentry/snuba:nightly
+ - environment:
+ SNUBA_SETTINGS: docker
+ CLICKHOUSE_HOST: {{ container["services"]["clickhouse"] }}
+ DEFAULT_BROKERS: {{ container["services"]["broker"] }}
+ REDIS_HOST: {{ container["services"]["redis"] }}
+ UWSGI_MAX_REQUESTS: 10000
+ UWSGI_DISABLE_LOGGING: "true"
+
+ # Leaving the value empty to just pass whatever is set
+ # on the host system (or in the .env file)
+ SENTRY_EVENT_RETENTION_DAYS:
+ - networks:
+ - {{ container["network"] }}
+
+# -------------------------------------------------------------
+# Bootstrap / migration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+Boostrap and migrate Snuba - {{ instance }}:
+ cmd.run:
+ - name: |
+ docker exec {{ instance }} bootstrap --no-migrate --force
+ docker exec {{ instance }} migrations migrate --force
+
+{% endfor %}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 06:39 (12 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2255760
Default Alt Text
D2881.id7340.diff (6 KB)
Attached To
Mode
D2881: Deploy Snuba containers for Sentry
Attached
Detach File
Event Timeline
Log In to Comment