Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4793986
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/pillar/paas/docker/docker-002/sentry.sls b/pillar/paas/docker/docker-002/sentry.sls
index ced85c1..32464de 100644
--- a/pillar/paas/docker/docker-002/sentry.sls
+++ b/pillar/paas/docker/docker-002/sentry.sls
@@ -1,109 +1,178 @@
# -------------------------------------------------------------
# Salt — Provision Docker engine
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# Service: Sentry
# -------------------------------------------------------------
docker_networks:
sentry:
subnet: 172.18.3.0/24
docker_images:
- library/postgres
- library/redis:3.2-alpine
- library/sentry
+ - getsentry/snuba:nightly
- tianon/exim4
- yandex/clickhouse-server:20.3.9.70
docker_containers:
#
# Core services used by Sentry
#
exim:
sentry_smtp:
mailname: mx.sentry.nasqueron.org
network: sentry
memcached:
sentry_memcached:
version: 1.6.9-alpine
network: sentry
redis:
sentry_redis:
network: sentry
postgresql:
sentry_db:
credential: nasqueron.sentry.postgresql
#
# Kafka instance
#
zookeeper:
sentry_zookeeper:
version: 5.5.0
network: sentry
kafka:
sentry_kafka:
version: 5.5.0
zookeeper: sentry_zookeeper
network: sentry
topics:
- ingest-attachments
- ingest-transactions
- ingest-events
- ingest-replay-recordings
#
# ClickHouse
#
clickhouse:
sentry_clickhouse:
version: 20.3.9.70
network: sentry
config: sentry.xml
max_memory_ratio: 0.2
#
- # Services maintained by Sentry
+ # Snuba
+ #
+
+ snuba:
+ sentry_snuba_api:
+ network: sentry
+ api: True
+ services: &sentry_snuba_services
+ broker: sentry_kafka:9092
+ clickhouse: sentry_clickhouse
+ redis: sentry_redis
+
+ 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:
sentry_web_1:
app_port: 26080
host: sentry.nasqueron.org
# As an instance is divided between a web, a cron and a worker
# containers, we need an identified to share a data volume.
realm: nasqueron
network: sentry
sentry_worker:
sentry_worker_1:
realm: nasqueron
network: sentry
sentry_cron:
sentry_cron:
realm: nasqueron
network: sentry
# -------------------------------------------------------------
# Services configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
kakfa_loggers:
kafka.cluster: WARN
kafka.controller: WARN
kafka.coordinator: WARN
kafka.log: WARN
kafka.server: WARN
kafka.zookeeper: WARN
state.change.logger: WARN
diff --git a/roles/paas-docker/containers/snuba.sls b/roles/paas-docker/containers/snuba.sls
new file mode 100644
index 0000000..dcff8ca
--- /dev/null
+++ b/roles/paas-docker/containers/snuba.sls
@@ -0,0 +1,53 @@
+# -------------------------------------------------------------
+# 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() %}
+{% set is_api = container.get("api", False) %}
+
+# -------------------------------------------------------------
+# Container
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ instance }}:
+ docker_container.running:
+ - detach: True
+ - interactive: True
+ - image: getsentry/snuba:nightly
+ {% if "command" in container %}
+ - command: {{ container["command"] }}
+ {% endif %}
+ - 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
+#
+# docker exec doesn't follow the entrypoint, so full command
+# is needed.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if is_api %}
+Boostrap and migrate Snuba - {{ instance }}:
+ cmd.run:
+ - name: |
+ docker exec {{ instance }} snuba bootstrap --no-migrate --force
+ docker exec {{ instance }} snuba migrations migrate --force
+{% endif %}
+
+{% endfor %}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Feb 28, 23:00 (23 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2448035
Default Alt Text
(7 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment