diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..c6c8b3621 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/sentry/templates/_helper-sentry-relay.tpl b/sentry/templates/_helper-sentry-relay.tpl new file mode 100644 index 000000000..b217d6328 --- /dev/null +++ b/sentry/templates/_helper-sentry-relay.tpl @@ -0,0 +1,36 @@ +{{- define "sentry.relay.config" -}} +{{- $redisHost := include "sentry.redis.host" . -}} +{{- $redisPort := include "sentry.redis.port" . -}} +{{- $redisPass := include "sentry.redis.password" . -}} +config.yml: |- + relay: + {{- if .Values.relay.mode }} + mode: {{ .Values.relay.mode }} + {{- end }} + upstream: "http://{{ template "sentry.fullname" . }}-web:{{ .Values.service.externalPort }}/" + host: 0.0.0.0 + port: {{ template "relay.port" }} + + processing: + enabled: true + {{- if .Values.geodata.path }} + geoip_path: {{ .Values.geodata.path | quote }} + {{- end }} + + kafka_config: + - name: "bootstrap.servers" + value: {{ (include "sentry.kafka.bootstrap_servers_string" .) | quote }} + - name: "message.max.bytes" + value: 50000000 # 50MB or bust + + {{- if $redisPass }} + redis: "redis://:{{ $redisPass }}@{{ $redisHost }}:{{ $redisPort }}" + {{- else }} + redis: "redis://{{ $redisHost }}:{{ $redisPort }}" + {{- end }} + topics: + metrics_transactions: ingest-performance-metrics + metrics_sessions: ingest-metrics + + {{ .Values.config.relay | nindent 2 }} +{{- end -}} diff --git a/sentry/templates/_helper-sentry.tpl b/sentry/templates/_helper-sentry.tpl new file mode 100644 index 000000000..a7eb0035a --- /dev/null +++ b/sentry/templates/_helper-sentry.tpl @@ -0,0 +1,573 @@ +{{- define "sentry.config" -}} +{{- $redisHost := include "sentry.redis.host" . -}} +{{- $redisPort := include "sentry.redis.port" . -}} +{{- $redisPass := include "sentry.redis.password" . -}} +config.yml: |- + {{- if .Values.system.adminEmail }} + system.admin-email: {{ .Values.system.adminEmail | quote }} + {{- end }} + {{- if .Values.system.url }} + system.url-prefix: {{ .Values.system.url | quote }} + {{- end }} + + # This URL will be used to tell Symbolicator where to obtain the Sentry source. + # See https://getsentry.github.io/symbolicator/api/ + system.internal-url-prefix: 'http://{{ template "sentry.fullname" . }}-web:{{ .Values.service.externalPort }}' + symbolicator.enabled: {{ .Values.symbolicator.enabled }} + {{- if .Values.symbolicator.enabled }} + symbolicator.options: + url: "http://{{ template "sentry.fullname" . }}-symbolicator:{{ template "symbolicator.port" }}" + {{- end }} + + ########## + # Github # + ########## + {{- with .Values.github.appId }} + github-app.id: {{ . }} + {{- end }} + {{- with .Values.github.appName }} + github-app.name: {{ . | quote }} + {{- end }} + {{- if not .Values.github.existingSecret }} + {{- with .Values.github.privateKey }} + github-app.private-key: {{- . | toYaml | indent 2 }} + {{- end }} + {{- with .Values.github.webhookSecret }} + github-app.webhook-secret: {{ . | quote }} + {{- end }} + {{- with .Values.github.clientId }} + github-app.client-id: {{ . | quote }} + {{- end }} + {{- with .Values.github.clientSecret }} + github-app.client-secret: {{ . | quote }} + {{- end }} + {{- end }} + + ########## + # Google # + ########## + {{- if and (.Values.google.clientId) (.Values.google.clientSecret) (not .Values.google.existingSecret) }} + auth-google.client-id: {{ .Values.google.clientId | quote }} + auth-google.client-secret: {{ .Values.google.clientSecret | quote }} + {{- end }} + + ######### + # Slack # + ######### + {{- if and (.Values.slack.clientId) (.Values.slack.clientSecret) (.Values.slack.signingSecret) (not .Values.slack.existingSecret) }} + slack.client-id: {{ .Values.slack.clientId | quote }} + slack.client-secret: {{ .Values.slack.clientSecret | quote }} + slack.signing-secret: {{ .Values.slack.signingSecret | quote }} + {{ end }} + + ######### + # Redis # + ######### + redis.clusters: + default: + hosts: + 0: + host: {{ $redisHost | quote }} + port: {{ $redisPort }} + {{- if $redisPass }} + password: {{ $redisPass | quote }} + {{- end }} + + ################ + # File storage # + ################ + # Uploaded media uses these `filestore` settings. The available + # backends are either `filesystem` or `s3`. + filestore.backend: {{ .Values.filestore.backend | quote }} + {{- if eq .Values.filestore.backend "filesystem" }} + filestore.options: + location: {{ .Values.filestore.filesystem.path | quote }} + {{ end }} + {{- if eq .Values.filestore.backend "gcs" }} + filestore.options: + bucket_name: {{ .Values.filestore.gcs.bucketName | quote }} + {{ end }} + + {{- if .Values.config.configYml }} + {{ .Values.config.configYml | toYaml | nindent 2 }} + {{- end }} +sentry.conf.py: |- + from sentry.conf.server import * # NOQA + from distutils.util import strtobool + + BYTE_MULTIPLIER = 1024 + UNITS = ("K", "M", "G") + def unit_text_to_bytes(text): + unit = text[-1].upper() + power = UNITS.index(unit) + 1 + return float(text[:-1])*(BYTE_MULTIPLIER**power) + + {{- if .Values.sourcemaps.enabled }} + CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache", + "LOCATION": [ + "{{ template "sentry.fullname" . }}-memcached:11211" + ], + "TIMEOUT": 3600, + "OPTIONS": {"ignore_exc": True} + } + } + {{- end }} + + DATABASES = { + "default": { + "ENGINE": "sentry.db.postgres", + "NAME": {{ include "sentry.postgresql.database" . | quote }}, + "USER": {{ include "sentry.postgresql.username" . | quote }}, + "PASSWORD": os.environ.get("POSTGRES_PASSWORD", ""), + "HOST": {{ include "sentry.postgresql.host" . | quote }}, + "PORT": {{ template "sentry.postgresql.port" . }}, + {{- if .Values.postgresql.enabled }} + "CONN_MAX_AGE": {{ .Values.postgresql.connMaxAge }}, + {{- else }} + "CONN_MAX_AGE": {{ .Values.externalPostgresql.connMaxAge }}, + {{- end }} + {{- if .Values.externalPostgresql.sslMode }} + 'OPTIONS': { + 'sslmode': '{{ .Values.externalPostgresql.sslMode }}', + }, + {{- end }} + } + } + + {{- if .Values.geodata.path }} + GEOIP_PATH_MMDB = {{ .Values.geodata.path | quote }} + {{- end }} + + # You should not change this setting after your database has been created + # unless you have altered all schemas first + SENTRY_USE_BIG_INTS = True + + ########### + # General # + ########### + + + secret_key = env('SENTRY_SECRET_KEY') + if not secret_key: + raise Exception('Error: SENTRY_SECRET_KEY is undefined') + + SENTRY_OPTIONS['system.secret-key'] = secret_key + + # Instruct Sentry that this install intends to be run by a single organization + # and thus various UI optimizations should be enabled. + SENTRY_SINGLE_ORGANIZATION = {{ if .Values.sentry.singleOrganization }}True{{ else }}False{{ end }} + + SENTRY_OPTIONS["system.event-retention-days"] = int(env('SENTRY_EVENT_RETENTION_DAYS') or {{ .Values.sentry.cleanup.days | quote }}) + + ######### + # Queue # + ######### + + # See https://docs.getsentry.com/on-premise/server/queue/ for more + # information on configuring your queue broker and workers. Sentry relies + # on a Python framework called Celery to manage queues. + + {{- if or (.Values.rabbitmq.enabled) (.Values.rabbitmq.host) }} + BROKER_URL = os.environ.get("BROKER_URL", "amqp://{{ .Values.rabbitmq.auth.username }}:{{ .Values.rabbitmq.auth.password }}@{{ template "sentry.rabbitmq.host" . }}:5672/{{ .Values.rabbitmq.vhost }}") + {{- else if $redisPass }} + BROKER_URL = os.environ.get("BROKER_URL", "redis://:{{ $redisPass }}@{{ $redisHost }}:{{ $redisPort }}/0") + {{- else }} + BROKER_URL = os.environ.get("BROKER_URL", "redis://{{ $redisHost }}:{{ $redisPort }}/0") + {{- end }} + + ######### + # Cache # + ######### + + # Sentry currently utilizes two separate mechanisms. While CACHES is not a + # requirement, it will optimize several high throughput patterns. + + # CACHES = { + # "default": { + # "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", + # "LOCATION": ["memcached:11211"], + # "TIMEOUT": 3600, + # } + # } + + # A primary cache is required for things such as processing events + SENTRY_CACHE = "sentry.cache.redis.RedisCache" + + DEFAULT_KAFKA_OPTIONS = { + "bootstrap.servers": {{ (include "sentry.kafka.bootstrap_servers_string" .) | quote }}, + "message.max.bytes": 50000000, + "socket.timeout.ms": 1000, + } + + SENTRY_EVENTSTREAM = "sentry.eventstream.kafka.KafkaEventStream" + SENTRY_EVENTSTREAM_OPTIONS = {"producer_configuration": DEFAULT_KAFKA_OPTIONS} + + KAFKA_CLUSTERS["default"] = DEFAULT_KAFKA_OPTIONS + + ############### + # Rate Limits # + ############### + + # Rate limits apply to notification handlers and are enforced per-project + # automatically. + + SENTRY_RATELIMITER = "sentry.ratelimits.redis.RedisRateLimiter" + + ################## + # Update Buffers # + ################## + + # Buffers (combined with queueing) act as an intermediate layer between the + # database and the storage API. They will greatly improve efficiency on large + # numbers of the same events being sent to the API in a short amount of time. + # (read: if you send any kind of real data to Sentry, you should enable buffers) + + SENTRY_BUFFER = "sentry.buffer.redis.RedisBuffer" + + ########## + # Quotas # + ########## + + # Quotas allow you to rate limit individual projects or the Sentry install as + # a whole. + + SENTRY_QUOTAS = "sentry.quotas.redis.RedisQuota" + + ######## + # TSDB # + ######## + + # The TSDB is used for building charts as well as making things like per-rate + # alerts possible. + + SENTRY_TSDB = "sentry.tsdb.redissnuba.RedisSnubaTSDB" + + ######### + # SNUBA # + ######### + + SENTRY_SEARCH = "sentry.search.snuba.EventsDatasetSnubaSearchBackend" + SENTRY_SEARCH_OPTIONS = {} + SENTRY_TAGSTORE_OPTIONS = {} + + ########### + # Digests # + ########### + + # The digest backend powers notification summaries. + + SENTRY_DIGESTS = "sentry.digests.backends.redis.RedisBackend" + + ################### + # Metrics Backend # + ################### + + SENTRY_RELEASE_HEALTH = "sentry.release_health.metrics.MetricsReleaseHealthBackend" + SENTRY_RELEASE_MONITOR = "sentry.release_health.release_monitor.metrics.MetricReleaseMonitorBackend" + + ############## + # Web Server # + ############## + + SENTRY_WEB_HOST = "0.0.0.0" + SENTRY_WEB_PORT = {{ template "sentry.port" }} + SENTRY_PUBLIC = {{ .Values.system.public | ternary "True" "False" }} + SENTRY_WEB_OPTIONS = { + "http": "%s:%s" % (SENTRY_WEB_HOST, SENTRY_WEB_PORT), + "protocol": "uwsgi", + # This is needed to prevent https://git.io/fj7Lw + "uwsgi-socket": None, + # Keep this between 15s-75s as that's what Relay supports + "http-keepalive": {{ .Values.config.web.httpKeepalive }}, + "http-chunked-input": True, + # the number of web workers + 'workers': 3, + # Turn off memory reporting + "memory-report": False, + # Some stuff so uwsgi will cycle workers sensibly + 'max-requests': 100000, + 'max-requests-delta': 500, + 'max-worker-lifetime': 86400, + # Duplicate options from sentry default just so we don't get + # bit by sentry changing a default value that we depend on. + 'thunder-lock': True, + 'log-x-forwarded-for': False, + 'buffer-size': 32768, + 'limit-post': 209715200, + 'disable-logging': True, + 'reload-on-rss': 600, + 'ignore-sigpipe': True, + 'ignore-write-errors': True, + 'disable-write-exception': True, + } + + ########### + # SSL/TLS # + ########### + + # If you're using a reverse SSL proxy, you should enable the X-Forwarded-Proto + # header and enable the settings below + + # SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') + # SESSION_COOKIE_SECURE = True + # CSRF_COOKIE_SECURE = True + # SOCIAL_AUTH_REDIRECT_IS_HTTPS = True + + # End of SSL/TLS settings + + ############ + # Features # + ############ + + + SENTRY_FEATURES = { + "auth:register": {{ .Values.auth.register | ternary "True" "False" }} + } + SENTRY_FEATURES["projects:sample-events"] = False + SENTRY_FEATURES.update( + { + feature: True + for feature in ( + {{- if not .Values.sentry.singleOrganization }} + "organizations:create", + {{ end -}} + + {{- if .Values.sentry.features.orgSubdomains }} + "organizations:org-subdomains", + {{ end -}} + + "organizations:advanced-search", + "organizations:android-mappings", + "organizations:api-keys", + "organizations:boolean-search", + "organizations:related-events", + "organizations:alert-filters", + "organizations:custom-symbol-sources", + "organizations:dashboards-basic", + "organizations:dashboards-edit", + "organizations:data-forwarding", + "organizations:discover", + "organizations:discover-basic", + "organizations:discover-query", + "organizations:discover-frontend-use-events-endpoint", + "organizations:enterprise-perf", + "organizations:event-attachments", + "organizations:events", + "organizations:global-views", + "organizations:incidents", + "organizations:metric-alert-builder-aggregate", + "organizations:metric-alert-gui-filters", + "organizations:integrations-event-hooks", + "organizations:integrations-issue-basic", + "organizations:integrations-issue-sync", + "organizations:integrations-alert-rule", + "organizations:integrations-chat-unfurl", + "organizations:integrations-incident-management", + "organizations:integrations-ticket-rules", + + {{- if .Values.sentry.features.vstsLimitedScopes }} + "organizations:integrations-vsts-limited-scopes", + {{ end -}} + + "organizations:integrations-stacktrace-link", + "organizations:internal-catchall", + "organizations:invite-members", + "organizations:large-debug-files", + "organizations:monitors", + "organizations:onboarding", + "organizations:org-saved-searches", + "organizations:performance-view", + "organizations:performance-frontend-use-events-endpoint", + "organizations:project-detail", + "organizations:relay", + "organizations:release-performance-views", + "organizations:rule-page", + "organizations:set-grouping-config", + "organizations:custom-event-title", + "organizations:slack-migration", + "organizations:sso-basic", + "organizations:sso-rippling", + "organizations:sso-saml2", + "organizations:sso-migration", + "organizations:stacktrace-hover-preview", + "organizations:symbol-sources", + "organizations:transaction-comparison", + "organizations:usage-stats-graph", + "organizations:inbox", + "organizations:unhandled-issue-flag", + "organizations:invite-members-rate-limits", + "organizations:dashboards-v2", + "organizations:reprocessing-v2", + "organizations:metrics", + "organizations:metrics-extraction", + "organizations:transaction-metrics-extraction", + + {{- if .Values.sentry.features.enableSessionReplay}} + "organizations:session-replay", + "organizations:session-replay-ui", + "organizations:session-replay-sdk", + "organizations:session-replay-count-query-optimize", + "organizations:session-replay-sdk-errors-only", + "organizations:session-replay-recording-scrubbing", + "organizations:session-replay-a11y-tab", + "organizations:session-replay-slack-new-issue", + "organizations:session-replay-issue-emails", + "organizations:session-replay-event-linking", + "organizations:session-replay-weekly-email", + "organizations:session-replay-trace-table", + "organizations:session-replay-rage-dead-selectors", + "organizations:session-replay-new-event-counts", + "organizations:session-replay-new-timeline", + "organizations:issue-details-replay-event", + {{ end -}} + + "organizations:issue-platform", + + {{- if .Values.sentry.features.enableProfiling }} + "organizations:profiling", + "organizations:profiling-ui-frames", + "organizations:profiling-using-transactions", + "organizations:profiling-beta", + "organizations:profiling-stacktrace-links", + "organizations:profiling-global-suspect-functions", + "organizations:profiling-cpu-chart", + "organizations:profiling-memory-chart", + "organizations:profiling-view", + {{ end -}} + + {{- if .Values.sentry.features.enableFeedback }} + "organizations:user-feedback-ui", + "organizations:user-feedback-ingest", + "organizations:feedback-ingest", + "organizations:feedback-post-process-group", + "organizations:feedback-visible", + {{ end -}} + + "organizations:dashboards-mep", + "organizations:mep-rollout-flag", + "organizations:dashboards-rh-widget", + "organizations:metrics-extraction", + "organizations:transaction-metrics-extraction", + + "projects:alert-filters", + "projects:custom-inbound-filters", + "projects:data-forwarding", + "projects:discard-groups", + "projects:issue-alerts-targeting", + "projects:minidump", + "projects:rate-limits", + "projects:sample-events", + "projects:servicehooks", + "projects:similarity-view", + "projects:similarity-indexing", + "projects:similarity-view-v2", + "projects:similarity-indexing-v2", + + "projects:plugins", + ) + } + ) + + ####################### + # Email Configuration # + ####################### + SENTRY_OPTIONS['mail.backend'] = os.getenv("SENTRY_EMAIL_BACKEND", {{ .Values.mail.backend | quote }}) + SENTRY_OPTIONS['mail.use-tls'] = bool(strtobool(os.getenv("SENTRY_EMAIL_USE_TLS", {{ .Values.mail.useTls | quote }}))) + SENTRY_OPTIONS['mail.use-ssl'] = bool(strtobool(os.getenv("SENTRY_EMAIL_USE_SSL", {{ .Values.mail.useSsl | quote }}))) + SENTRY_OPTIONS['mail.username'] = os.getenv("SENTRY_EMAIL_USERNAME", {{ .Values.mail.username | quote }}) + SENTRY_OPTIONS['mail.password'] = os.getenv("SENTRY_EMAIL_PASSWORD", "") + SENTRY_OPTIONS['mail.port'] = int(os.getenv("SENTRY_EMAIL_PORT", {{ .Values.mail.port | quote }})) + SENTRY_OPTIONS['mail.host'] = os.getenv("SENTRY_EMAIL_HOST", {{ .Values.mail.host | quote }}) + SENTRY_OPTIONS['mail.from'] = os.getenv("SENTRY_EMAIL_FROM", {{ .Values.mail.from | quote }}) + + ####################### + # Filestore S3 Configuration # + ####################### + {{- if eq .Values.filestore.backend "s3" }} + SENTRY_OPTIONS['filestore.options'] = { + 'access_key': os.getenv("S3_ACCESS_KEY_ID", {{ .Values.filestore.s3.accessKey | default "" | quote }}), + 'secret_key': os.getenv("S3_SECRET_ACCESS_KEY", {{ .Values.filestore.s3.secretKey | default "" | quote }}), + {{- if .Values.filestore.s3.bucketName }} + 'bucket_name': {{ .Values.filestore.s3.bucketName | quote }}, + {{- end }} + {{- if .Values.filestore.s3.endpointUrl }} + 'endpoint_url': {{ .Values.filestore.s3.endpointUrl | quote }}, + {{- end }} + {{- if .Values.filestore.s3.signature_version }} + 'signature_version': {{ .Values.filestore.s3.signature_version | quote }}, + {{- end }} + {{- if .Values.filestore.s3.region_name }} + 'region_name': {{ .Values.filestore.s3.region_name | quote }}, + {{- end }} + {{- if .Values.filestore.s3.default_acl }} + 'default_acl': {{ .Values.filestore.s3.default_acl | quote }}, + {{- end }} + #add comfig params for s3 + {{- if .Values.filestore.s3.addressing_style }} + 'addressing_style': {{ .Values.filestore.s3.addressing_style | quote }}, + {{- end }} + {{- if .Values.filestore.s3.location }} + 'location': {{ .Values.filestore.s3.location | quote }}, + {{- end }} + } + {{- end }} + + ######################### + # Bitbucket Integration # + ######################### + + # BITBUCKET_CONSUMER_KEY = 'YOUR_BITBUCKET_CONSUMER_KEY' + # BITBUCKET_CONSUMER_SECRET = 'YOUR_BITBUCKET_CONSUMER_SECRET' + + ######### + # Relay # + ######### + SENTRY_RELAY_WHITELIST_PK = [] + SENTRY_RELAY_OPEN_REGISTRATION = True + + ####################### + # OpenAi Suggestions # + ####################### + + OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", "") + if OPENAI_API_KEY: + SENTRY_FEATURES["organizations:open-ai-suggestion"] = True + +{{- if .Values.metrics.enabled }} + SENTRY_METRICS_BACKEND = 'sentry.metrics.statsd.StatsdMetricsBackend' + SENTRY_METRICS_OPTIONS = { + 'host': '{{ template "sentry.fullname" . }}-metrics', + 'port': 9125, + } +{{- end }} + +{{- if .Values.slack.existingSecret }} + ######### + # SLACK # + ######### + SENTRY_OPTIONS['slack.client-id'] = os.environ.get("SLACK_CLIENT_ID") + SENTRY_OPTIONS['slack.client-secret'] = os.environ.get("SLACK_CLIENT_SECRET") + SENTRY_OPTIONS['slack.signing-secret'] = os.environ.get("SLACK_SIGNING_SECRET") +{{- end }} + +{{- if .Values.google.existingSecret }} + ######### + # GOOGLE # + ######### + SENTRY_OPTIONS['auth-google.client-id'] = os.environ.get("GOOGLE_AUTH_CLIENT_ID") + SENTRY_OPTIONS['auth-google.client-secret'] = os.environ.get("GOOGLE_AUTH_CLIENT_SECRET") +{{- end }} + +{{- if .Values.github.existingSecret }} + ########## + # Github # + ########## + SENTRY_OPTIONS['github-app.private-key'] = os.environ.get("GITHUB_APP_PRIVATE_KEY") + SENTRY_OPTIONS['github-app.webhook-secret'] = os.environ.get("GITHUB_APP_WEBHOOK_SECRET") + SENTRY_OPTIONS['github-app.client-id'] = os.environ.get("GITHUB_APP_CLIENT_ID") + SENTRY_OPTIONS['github-app.client-secret'] = os.environ.get("GITHUB_APP_CLIENT_SECRET") +{{- end }} + {{ .Values.config.sentryConfPy | nindent 2 }} +{{- end -}} diff --git a/sentry/templates/_helper-snuba.tpl b/sentry/templates/_helper-snuba.tpl new file mode 100644 index 000000000..50f52145b --- /dev/null +++ b/sentry/templates/_helper-snuba.tpl @@ -0,0 +1,75 @@ +{{- define "sentry.snuba.config" -}} +{{- $redisPass := include "sentry.redis.password" . -}} +settings.py: | + import os + + from snuba.settings import * + + env = os.environ.get + + DEBUG = env("DEBUG", "0").lower() in ("1", "true") + + # Clickhouse Options + CLUSTERS = [ + { + "host": env("CLICKHOUSE_HOST", {{ include "sentry.clickhouse.host" . | quote }}), + "port": int({{ include "sentry.clickhouse.port" . }}), + "user": env("CLICKHOUSE_USER", "default"), + "password": env("CLICKHOUSE_PASSWORD", ""), + "max_connections": int(os.environ.get("CLICKHOUSE_MAX_CONNECTIONS", 100)), + "database": env("CLICKHOUSE_DATABASE", "default"), + "http_port": {{ include "sentry.clickhouse.http_port" . }}, + "storage_sets": { + "cdc", + "discover", + "events", + "events_ro", + "metrics", + "metrics_summaries", + "migrations", + "outcomes", + "querylog", + "sessions", + "transactions", + "profiles", + "functions", + "replays", + "generic_metrics_sets", + "generic_metrics_distributions", + "search_issues", + "generic_metrics_counters", + "spans", + "group_attributes", + "generic_metrics_gauges", + }, + {{- /* + The default clickhouse installation runs in distributed mode, while the external + clickhouse configured can be configured any way you choose + */}} + {{- if and .Values.externalClickhouse.singleNode (not .Values.clickhouse.enabled) }} + "single_node": True, + {{- else }} + "single_node": False, + {{- end }} + {{- if or .Values.clickhouse.enabled (not .Values.externalClickhouse.singleNode) }} + "cluster_name": {{ include "sentry.clickhouse.cluster.name" . | quote }}, + "distributed_cluster_name": {{ include "sentry.clickhouse.cluster.name" . | quote }}, + {{- end }} + }, + ] + + # Redis Options + REDIS_HOST = {{ include "sentry.redis.host" . | quote }} + REDIS_PORT = {{ include "sentry.redis.port" . }} + {{- if $redisPass }} + REDIS_PASSWORD = {{ $redisPass | quote }} + {{- end }} + REDIS_DB = int(env("REDIS_DB", 1)) + +{{- if .Values.metrics.enabled }} + DOGSTATSD_HOST = "{{ template "sentry.fullname" . }}-metrics" + DOGSTATSD_PORT = 9125 +{{- end }} + + {{ .Values.config.snubaSettingsPy | nindent 2 }} +{{- end -}} diff --git a/sentry/templates/_helper-symbolicator.tpl b/sentry/templates/_helper-symbolicator.tpl new file mode 100644 index 000000000..52e96b4a9 --- /dev/null +++ b/sentry/templates/_helper-symbolicator.tpl @@ -0,0 +1,3 @@ +{{- define "sentry.symbolicator.config" -}} +config.yml: {{ toYaml .Values.symbolicator.api.config }} +{{- end -}} diff --git a/sentry/templates/configmap-relay.yaml b/sentry/templates/configmap-relay.yaml index 9e93ae8eb..54826c83c 100644 --- a/sentry/templates/configmap-relay.yaml +++ b/sentry/templates/configmap-relay.yaml @@ -1,7 +1,4 @@ {{- if .Values.relay.enabled }} -{{- $redisHost := include "sentry.redis.host" . -}} -{{- $redisPort := include "sentry.redis.port" . -}} -{{- $redisPass := include "sentry.redis.password" . -}} apiVersion: v1 kind: ConfigMap metadata: @@ -12,35 +9,5 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" data: - config.yml: |- - relay: - {{- if .Values.relay.mode }} - mode: {{ .Values.relay.mode }} - {{- end }} - upstream: "http://{{ template "sentry.fullname" . }}-web:{{ .Values.service.externalPort }}/" - host: 0.0.0.0 - port: {{ template "relay.port" }} - - processing: - enabled: true - {{- if .Values.geodata.path }} - geoip_path: {{ .Values.geodata.path | quote }} - {{- end }} - - kafka_config: - - name: "bootstrap.servers" - value: {{ (include "sentry.kafka.bootstrap_servers_string" .) | quote }} - - name: "message.max.bytes" - value: 50000000 # 50MB or bust - - {{- if $redisPass }} - redis: "redis://:{{ $redisPass }}@{{ $redisHost }}:{{ $redisPort }}" - {{- else }} - redis: "redis://{{ $redisHost }}:{{ $redisPort }}" - {{- end }} - topics: - metrics_transactions: ingest-performance-metrics - metrics_sessions: ingest-metrics - -{{ .Values.config.relay | indent 4 }} + {{ include "sentry.relay.config" . | nindent 2 }} {{- end }} diff --git a/sentry/templates/configmap-sentry.yaml b/sentry/templates/configmap-sentry.yaml index e535598d1..986f74231 100644 --- a/sentry/templates/configmap-sentry.yaml +++ b/sentry/templates/configmap-sentry.yaml @@ -1,6 +1,3 @@ -{{- $redisHost := include "sentry.redis.host" . -}} -{{- $redisPort := include "sentry.redis.port" . -}} -{{- $redisPass := include "sentry.redis.password" . -}} apiVersion: v1 kind: ConfigMap metadata: @@ -11,571 +8,4 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" data: - config.yml: |- - {{- if .Values.system.adminEmail }} - system.admin-email: {{ .Values.system.adminEmail | quote }} - {{- end }} - {{- if .Values.system.url }} - system.url-prefix: {{ .Values.system.url | quote }} - {{- end }} - - # This URL will be used to tell Symbolicator where to obtain the Sentry source. - # See https://getsentry.github.io/symbolicator/api/ - system.internal-url-prefix: 'http://{{ template "sentry.fullname" . }}-web:{{ .Values.service.externalPort }}' - symbolicator.enabled: {{ .Values.symbolicator.enabled }} - {{- if .Values.symbolicator.enabled }} - symbolicator.options: - url: "http://{{ template "sentry.fullname" . }}-symbolicator:{{ template "symbolicator.port" }}" - {{- end }} - - ########## - # Github # - ########## - {{- with .Values.github.appId }} - github-app.id: {{ . }} - {{- end }} - {{- with .Values.github.appName }} - github-app.name: {{ . | quote }} - {{- end }} - {{- if not .Values.github.existingSecret }} - {{- with .Values.github.privateKey }} - github-app.private-key: {{- . | toYaml | indent 4 }} - {{- end }} - {{- with .Values.github.webhookSecret }} - github-app.webhook-secret: {{ . | quote }} - {{- end }} - {{- with .Values.github.clientId }} - github-app.client-id: {{ . | quote }} - {{- end }} - {{- with .Values.github.clientSecret }} - github-app.client-secret: {{ . | quote }} - {{- end }} - {{- end }} - - ########## - # Google # - ########## - {{- if and (.Values.google.clientId) (.Values.google.clientSecret) (not .Values.google.existingSecret) }} - auth-google.client-id: {{ .Values.google.clientId | quote }} - auth-google.client-secret: {{ .Values.google.clientSecret | quote }} - {{- end }} - - ######### - # Slack # - ######### - {{- if and (.Values.slack.clientId) (.Values.slack.clientSecret) (.Values.slack.signingSecret) (not .Values.slack.existingSecret) }} - slack.client-id: {{ .Values.slack.clientId | quote }} - slack.client-secret: {{ .Values.slack.clientSecret | quote }} - slack.signing-secret: {{ .Values.slack.signingSecret | quote }} - {{ end }} - - ######### - # Redis # - ######### - redis.clusters: - default: - hosts: - 0: - host: {{ $redisHost | quote }} - port: {{ $redisPort }} - {{- if $redisPass }} - password: {{ $redisPass | quote }} - {{- end }} - - ################ - # File storage # - ################ - # Uploaded media uses these `filestore` settings. The available - # backends are either `filesystem` or `s3`. - filestore.backend: {{ .Values.filestore.backend | quote }} - {{- if eq .Values.filestore.backend "filesystem" }} - filestore.options: - location: {{ .Values.filestore.filesystem.path | quote }} - {{ end }} - {{- if eq .Values.filestore.backend "gcs" }} - filestore.options: - bucket_name: {{ .Values.filestore.gcs.bucketName | quote }} - {{ end }} - - {{- if .Values.config.configYml }} -{{ .Values.config.configYml | toYaml | indent 4 }} - {{- end }} - sentry.conf.py: |- - from sentry.conf.server import * # NOQA - from distutils.util import strtobool - - BYTE_MULTIPLIER = 1024 - UNITS = ("K", "M", "G") - def unit_text_to_bytes(text): - unit = text[-1].upper() - power = UNITS.index(unit) + 1 - return float(text[:-1])*(BYTE_MULTIPLIER**power) - - {{- if .Values.sourcemaps.enabled }} - CACHES = { - "default": { - "BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache", - "LOCATION": [ - "{{ template "sentry.fullname" . }}-memcached:11211" - ], - "TIMEOUT": 3600, - "OPTIONS": {"ignore_exc": True} - } - } - {{- end }} - - DATABASES = { - "default": { - "ENGINE": "sentry.db.postgres", - "NAME": {{ include "sentry.postgresql.database" . | quote }}, - "USER": {{ include "sentry.postgresql.username" . | quote }}, - "PASSWORD": os.environ.get("POSTGRES_PASSWORD", ""), - "HOST": {{ include "sentry.postgresql.host" . | quote }}, - "PORT": {{ template "sentry.postgresql.port" . }}, - {{- if .Values.postgresql.enabled }} - "CONN_MAX_AGE": {{ .Values.postgresql.connMaxAge }}, - {{- else }} - "CONN_MAX_AGE": {{ .Values.externalPostgresql.connMaxAge }}, - {{- end }} - {{- if .Values.externalPostgresql.sslMode }} - 'OPTIONS': { - 'sslmode': '{{ .Values.externalPostgresql.sslMode }}', - }, - {{- end }} - } - } - - {{- if .Values.geodata.path }} - GEOIP_PATH_MMDB = {{ .Values.geodata.path | quote }} - {{- end }} - - # You should not change this setting after your database has been created - # unless you have altered all schemas first - SENTRY_USE_BIG_INTS = True - - ########### - # General # - ########### - - - secret_key = env('SENTRY_SECRET_KEY') - if not secret_key: - raise Exception('Error: SENTRY_SECRET_KEY is undefined') - - SENTRY_OPTIONS['system.secret-key'] = secret_key - - # Instruct Sentry that this install intends to be run by a single organization - # and thus various UI optimizations should be enabled. - SENTRY_SINGLE_ORGANIZATION = {{ if .Values.sentry.singleOrganization }}True{{ else }}False{{ end }} - - SENTRY_OPTIONS["system.event-retention-days"] = int(env('SENTRY_EVENT_RETENTION_DAYS') or {{ .Values.sentry.cleanup.days | quote }}) - - ######### - # Queue # - ######### - - # See https://docs.getsentry.com/on-premise/server/queue/ for more - # information on configuring your queue broker and workers. Sentry relies - # on a Python framework called Celery to manage queues. - - {{- if or (.Values.rabbitmq.enabled) (.Values.rabbitmq.host) }} - BROKER_URL = os.environ.get("BROKER_URL", "amqp://{{ .Values.rabbitmq.auth.username }}:{{ .Values.rabbitmq.auth.password }}@{{ template "sentry.rabbitmq.host" . }}:5672/{{ .Values.rabbitmq.vhost }}") - {{- else if $redisPass }} - BROKER_URL = os.environ.get("BROKER_URL", "redis://:{{ $redisPass }}@{{ $redisHost }}:{{ $redisPort }}/0") - {{- else }} - BROKER_URL = os.environ.get("BROKER_URL", "redis://{{ $redisHost }}:{{ $redisPort }}/0") - {{- end }} - - ######### - # Cache # - ######### - - # Sentry currently utilizes two separate mechanisms. While CACHES is not a - # requirement, it will optimize several high throughput patterns. - - # CACHES = { - # "default": { - # "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", - # "LOCATION": ["memcached:11211"], - # "TIMEOUT": 3600, - # } - # } - - # A primary cache is required for things such as processing events - SENTRY_CACHE = "sentry.cache.redis.RedisCache" - - DEFAULT_KAFKA_OPTIONS = { - "bootstrap.servers": {{ (include "sentry.kafka.bootstrap_servers_string" .) | quote }}, - "message.max.bytes": 50000000, - "socket.timeout.ms": 1000, - } - - SENTRY_EVENTSTREAM = "sentry.eventstream.kafka.KafkaEventStream" - SENTRY_EVENTSTREAM_OPTIONS = {"producer_configuration": DEFAULT_KAFKA_OPTIONS} - - KAFKA_CLUSTERS["default"] = DEFAULT_KAFKA_OPTIONS - - ############### - # Rate Limits # - ############### - - # Rate limits apply to notification handlers and are enforced per-project - # automatically. - - SENTRY_RATELIMITER = "sentry.ratelimits.redis.RedisRateLimiter" - - ################## - # Update Buffers # - ################## - - # Buffers (combined with queueing) act as an intermediate layer between the - # database and the storage API. They will greatly improve efficiency on large - # numbers of the same events being sent to the API in a short amount of time. - # (read: if you send any kind of real data to Sentry, you should enable buffers) - - SENTRY_BUFFER = "sentry.buffer.redis.RedisBuffer" - - ########## - # Quotas # - ########## - - # Quotas allow you to rate limit individual projects or the Sentry install as - # a whole. - - SENTRY_QUOTAS = "sentry.quotas.redis.RedisQuota" - - ######## - # TSDB # - ######## - - # The TSDB is used for building charts as well as making things like per-rate - # alerts possible. - - SENTRY_TSDB = "sentry.tsdb.redissnuba.RedisSnubaTSDB" - - ######### - # SNUBA # - ######### - - SENTRY_SEARCH = "sentry.search.snuba.EventsDatasetSnubaSearchBackend" - SENTRY_SEARCH_OPTIONS = {} - SENTRY_TAGSTORE_OPTIONS = {} - - ########### - # Digests # - ########### - - # The digest backend powers notification summaries. - - SENTRY_DIGESTS = "sentry.digests.backends.redis.RedisBackend" - - ################### - # Metrics Backend # - ################### - - SENTRY_RELEASE_HEALTH = "sentry.release_health.metrics.MetricsReleaseHealthBackend" - SENTRY_RELEASE_MONITOR = "sentry.release_health.release_monitor.metrics.MetricReleaseMonitorBackend" - - ############## - # Web Server # - ############## - - SENTRY_WEB_HOST = "0.0.0.0" - SENTRY_WEB_PORT = {{ template "sentry.port" }} - SENTRY_PUBLIC = {{ .Values.system.public | ternary "True" "False" }} - SENTRY_WEB_OPTIONS = { - "http": "%s:%s" % (SENTRY_WEB_HOST, SENTRY_WEB_PORT), - "protocol": "uwsgi", - # This is needed to prevent https://git.io/fj7Lw - "uwsgi-socket": None, - # Keep this between 15s-75s as that's what Relay supports - "http-keepalive": {{ .Values.config.web.httpKeepalive }}, - "http-chunked-input": True, - # the number of web workers - 'workers': 3, - # Turn off memory reporting - "memory-report": False, - # Some stuff so uwsgi will cycle workers sensibly - 'max-requests': 100000, - 'max-requests-delta': 500, - 'max-worker-lifetime': 86400, - # Duplicate options from sentry default just so we don't get - # bit by sentry changing a default value that we depend on. - 'thunder-lock': True, - 'log-x-forwarded-for': False, - 'buffer-size': 32768, - 'limit-post': 209715200, - 'disable-logging': True, - 'reload-on-rss': 600, - 'ignore-sigpipe': True, - 'ignore-write-errors': True, - 'disable-write-exception': True, - } - - ########### - # SSL/TLS # - ########### - - # If you're using a reverse SSL proxy, you should enable the X-Forwarded-Proto - # header and enable the settings below - - # SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') - # SESSION_COOKIE_SECURE = True - # CSRF_COOKIE_SECURE = True - # SOCIAL_AUTH_REDIRECT_IS_HTTPS = True - - # End of SSL/TLS settings - - ############ - # Features # - ############ - - - SENTRY_FEATURES = { - "auth:register": {{ .Values.auth.register | ternary "True" "False" }} - } - SENTRY_FEATURES["projects:sample-events"] = False - SENTRY_FEATURES.update( - { - feature: True - for feature in ( - {{- if not .Values.sentry.singleOrganization }} - "organizations:create", - {{ end -}} - - {{- if .Values.sentry.features.orgSubdomains }} - "organizations:org-subdomains", - {{ end -}} - - "organizations:advanced-search", - "organizations:android-mappings", - "organizations:api-keys", - "organizations:boolean-search", - "organizations:related-events", - "organizations:alert-filters", - "organizations:custom-symbol-sources", - "organizations:dashboards-basic", - "organizations:dashboards-edit", - "organizations:data-forwarding", - "organizations:discover", - "organizations:discover-basic", - "organizations:discover-query", - "organizations:discover-frontend-use-events-endpoint", - "organizations:enterprise-perf", - "organizations:event-attachments", - "organizations:events", - "organizations:global-views", - "organizations:incidents", - "organizations:metric-alert-builder-aggregate", - "organizations:metric-alert-gui-filters", - "organizations:integrations-event-hooks", - "organizations:integrations-issue-basic", - "organizations:integrations-issue-sync", - "organizations:integrations-alert-rule", - "organizations:integrations-chat-unfurl", - "organizations:integrations-incident-management", - "organizations:integrations-ticket-rules", - - {{- if .Values.sentry.features.vstsLimitedScopes }} - "organizations:integrations-vsts-limited-scopes", - {{ end -}} - - "organizations:integrations-stacktrace-link", - "organizations:internal-catchall", - "organizations:invite-members", - "organizations:large-debug-files", - "organizations:monitors", - "organizations:onboarding", - "organizations:org-saved-searches", - "organizations:performance-view", - "organizations:performance-frontend-use-events-endpoint", - "organizations:project-detail", - "organizations:relay", - "organizations:release-performance-views", - "organizations:rule-page", - "organizations:set-grouping-config", - "organizations:custom-event-title", - "organizations:slack-migration", - "organizations:sso-basic", - "organizations:sso-rippling", - "organizations:sso-saml2", - "organizations:sso-migration", - "organizations:stacktrace-hover-preview", - "organizations:symbol-sources", - "organizations:transaction-comparison", - "organizations:usage-stats-graph", - "organizations:inbox", - "organizations:unhandled-issue-flag", - "organizations:invite-members-rate-limits", - "organizations:dashboards-v2", - "organizations:reprocessing-v2", - "organizations:metrics", - "organizations:metrics-extraction", - "organizations:transaction-metrics-extraction", - - {{- if .Values.sentry.features.enableSessionReplay}} - "organizations:session-replay", - "organizations:session-replay-ui", - "organizations:session-replay-sdk", - "organizations:session-replay-count-query-optimize", - "organizations:session-replay-sdk-errors-only", - "organizations:session-replay-recording-scrubbing", - "organizations:session-replay-a11y-tab", - "organizations:session-replay-slack-new-issue", - "organizations:session-replay-issue-emails", - "organizations:session-replay-event-linking", - "organizations:session-replay-weekly-email", - "organizations:session-replay-trace-table", - "organizations:session-replay-rage-dead-selectors", - "organizations:session-replay-new-event-counts", - "organizations:session-replay-new-timeline", - "organizations:issue-details-replay-event", - {{ end -}} - - "organizations:issue-platform", - - {{- if .Values.sentry.features.enableProfiling }} - "organizations:profiling", - "organizations:profiling-ui-frames", - "organizations:profiling-using-transactions", - "organizations:profiling-beta", - "organizations:profiling-stacktrace-links", - "organizations:profiling-global-suspect-functions", - "organizations:profiling-cpu-chart", - "organizations:profiling-memory-chart", - "organizations:profiling-view", - {{ end -}} - - {{- if .Values.sentry.features.enableFeedback }} - "organizations:user-feedback-ui", - "organizations:user-feedback-ingest", - "organizations:feedback-ingest", - "organizations:feedback-post-process-group", - "organizations:feedback-visible", - {{ end -}} - - "organizations:dashboards-mep", - "organizations:mep-rollout-flag", - "organizations:dashboards-rh-widget", - "organizations:metrics-extraction", - "organizations:transaction-metrics-extraction", - - "projects:alert-filters", - "projects:custom-inbound-filters", - "projects:data-forwarding", - "projects:discard-groups", - "projects:issue-alerts-targeting", - "projects:minidump", - "projects:rate-limits", - "projects:sample-events", - "projects:servicehooks", - "projects:similarity-view", - "projects:similarity-indexing", - "projects:similarity-view-v2", - "projects:similarity-indexing-v2", - - "projects:plugins", - ) - } - ) - - ####################### - # Email Configuration # - ####################### - SENTRY_OPTIONS['mail.backend'] = os.getenv("SENTRY_EMAIL_BACKEND", {{ .Values.mail.backend | quote }}) - SENTRY_OPTIONS['mail.use-tls'] = bool(strtobool(os.getenv("SENTRY_EMAIL_USE_TLS", {{ .Values.mail.useTls | quote }}))) - SENTRY_OPTIONS['mail.use-ssl'] = bool(strtobool(os.getenv("SENTRY_EMAIL_USE_SSL", {{ .Values.mail.useSsl | quote }}))) - SENTRY_OPTIONS['mail.username'] = os.getenv("SENTRY_EMAIL_USERNAME", {{ .Values.mail.username | quote }}) - SENTRY_OPTIONS['mail.password'] = os.getenv("SENTRY_EMAIL_PASSWORD", "") - SENTRY_OPTIONS['mail.port'] = int(os.getenv("SENTRY_EMAIL_PORT", {{ .Values.mail.port | quote }})) - SENTRY_OPTIONS['mail.host'] = os.getenv("SENTRY_EMAIL_HOST", {{ .Values.mail.host | quote }}) - SENTRY_OPTIONS['mail.from'] = os.getenv("SENTRY_EMAIL_FROM", {{ .Values.mail.from | quote }}) - - ####################### - # Filestore S3 Configuration # - ####################### - {{- if eq .Values.filestore.backend "s3" }} - SENTRY_OPTIONS['filestore.options'] = { - 'access_key': os.getenv("S3_ACCESS_KEY_ID", {{ .Values.filestore.s3.accessKey | default "" | quote }}), - 'secret_key': os.getenv("S3_SECRET_ACCESS_KEY", {{ .Values.filestore.s3.secretKey | default "" | quote }}), - {{- if .Values.filestore.s3.bucketName }} - 'bucket_name': {{ .Values.filestore.s3.bucketName | quote }}, - {{- end }} - {{- if .Values.filestore.s3.endpointUrl }} - 'endpoint_url': {{ .Values.filestore.s3.endpointUrl | quote }}, - {{- end }} - {{- if .Values.filestore.s3.signature_version }} - 'signature_version': {{ .Values.filestore.s3.signature_version | quote }}, - {{- end }} - {{- if .Values.filestore.s3.region_name }} - 'region_name': {{ .Values.filestore.s3.region_name | quote }}, - {{- end }} - {{- if .Values.filestore.s3.default_acl }} - 'default_acl': {{ .Values.filestore.s3.default_acl | quote }}, - {{- end }} - #add comfig params for s3 - {{- if .Values.filestore.s3.addressing_style }} - 'addressing_style': {{ .Values.filestore.s3.addressing_style | quote }}, - {{- end }} - {{- if .Values.filestore.s3.location }} - 'location': {{ .Values.filestore.s3.location | quote }}, - {{- end }} - } - {{- end }} - - ######################### - # Bitbucket Integration # - ######################### - - # BITBUCKET_CONSUMER_KEY = 'YOUR_BITBUCKET_CONSUMER_KEY' - # BITBUCKET_CONSUMER_SECRET = 'YOUR_BITBUCKET_CONSUMER_SECRET' - - ######### - # Relay # - ######### - SENTRY_RELAY_WHITELIST_PK = [] - SENTRY_RELAY_OPEN_REGISTRATION = True - - ####################### - # OpenAi Suggestions # - ####################### - - OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", "") - if OPENAI_API_KEY: - SENTRY_FEATURES["organizations:open-ai-suggestion"] = True - -{{- if .Values.metrics.enabled }} - SENTRY_METRICS_BACKEND = 'sentry.metrics.statsd.StatsdMetricsBackend' - SENTRY_METRICS_OPTIONS = { - 'host': '{{ template "sentry.fullname" . }}-metrics', - 'port': 9125, - } -{{- end }} - -{{- if .Values.slack.existingSecret }} - ######### - # SLACK # - ######### - SENTRY_OPTIONS['slack.client-id'] = os.environ.get("SLACK_CLIENT_ID") - SENTRY_OPTIONS['slack.client-secret'] = os.environ.get("SLACK_CLIENT_SECRET") - SENTRY_OPTIONS['slack.signing-secret'] = os.environ.get("SLACK_SIGNING_SECRET") -{{- end }} - -{{- if .Values.google.existingSecret }} - ######### - # GOOGLE # - ######### - SENTRY_OPTIONS['auth-google.client-id'] = os.environ.get("GOOGLE_AUTH_CLIENT_ID") - SENTRY_OPTIONS['auth-google.client-secret'] = os.environ.get("GOOGLE_AUTH_CLIENT_SECRET") -{{- end }} - -{{- if .Values.github.existingSecret }} - ########## - # Github # - ########## - SENTRY_OPTIONS['github-app.private-key'] = os.environ.get("GITHUB_APP_PRIVATE_KEY") - SENTRY_OPTIONS['github-app.webhook-secret'] = os.environ.get("GITHUB_APP_WEBHOOK_SECRET") - SENTRY_OPTIONS['github-app.client-id'] = os.environ.get("GITHUB_APP_CLIENT_ID") - SENTRY_OPTIONS['github-app.client-secret'] = os.environ.get("GITHUB_APP_CLIENT_SECRET") -{{- end }} -{{ .Values.config.sentryConfPy | indent 4 }} + {{ include "sentry.config" . | nindent 2 }} diff --git a/sentry/templates/configmap-snuba.yaml b/sentry/templates/configmap-snuba.yaml index 018b09cf9..6dd59861f 100644 --- a/sentry/templates/configmap-snuba.yaml +++ b/sentry/templates/configmap-snuba.yaml @@ -1,4 +1,3 @@ -{{- $redisPass := include "sentry.redis.password" . -}} apiVersion: v1 kind: ConfigMap metadata: @@ -9,75 +8,4 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" data: - settings.py: | - import os - - from snuba.settings import * - - env = os.environ.get - - DEBUG = env("DEBUG", "0").lower() in ("1", "true") - - # Clickhouse Options - CLUSTERS = [ - { - "host": env("CLICKHOUSE_HOST", {{ include "sentry.clickhouse.host" . | quote }}), - "port": int({{ include "sentry.clickhouse.port" . }}), - "user": env("CLICKHOUSE_USER", "default"), - "password": env("CLICKHOUSE_PASSWORD", ""), - "max_connections": int(os.environ.get("CLICKHOUSE_MAX_CONNECTIONS", 100)), - "database": env("CLICKHOUSE_DATABASE", "default"), - "http_port": {{ include "sentry.clickhouse.http_port" . }}, - "storage_sets": { - "cdc", - "discover", - "events", - "events_ro", - "metrics", - "metrics_summaries", - "migrations", - "outcomes", - "querylog", - "sessions", - "transactions", - "profiles", - "functions", - "replays", - "generic_metrics_sets", - "generic_metrics_distributions", - "search_issues", - "generic_metrics_counters", - "spans", - "group_attributes", - "generic_metrics_gauges", - }, - {{- /* - The default clickhouse installation runs in distributed mode, while the external - clickhouse configured can be configured any way you choose - */}} - {{- if and .Values.externalClickhouse.singleNode (not .Values.clickhouse.enabled) }} - "single_node": True, - {{- else }} - "single_node": False, - {{- end }} - {{- if or .Values.clickhouse.enabled (not .Values.externalClickhouse.singleNode) }} - "cluster_name": {{ include "sentry.clickhouse.cluster.name" . | quote }}, - "distributed_cluster_name": {{ include "sentry.clickhouse.cluster.name" . | quote }}, - {{- end }} - }, - ] - - # Redis Options - REDIS_HOST = {{ include "sentry.redis.host" . | quote }} - REDIS_PORT = {{ include "sentry.redis.port" . }} - {{- if $redisPass }} - REDIS_PASSWORD = {{ $redisPass | quote }} - {{- end }} - REDIS_DB = int(env("REDIS_DB", 1)) - -{{- if .Values.metrics.enabled }} - DOGSTATSD_HOST = "{{ template "sentry.fullname" . }}-metrics" - DOGSTATSD_PORT = 9125 -{{- end }} - -{{ .Values.config.snubaSettingsPy | indent 4 }} + {{ include "sentry.snuba.config" . | nindent 2 }} diff --git a/sentry/templates/configmap-symbolicator.yaml b/sentry/templates/configmap-symbolicator.yaml index 2b73cfd51..8867ad48a 100644 --- a/sentry/templates/configmap-symbolicator.yaml +++ b/sentry/templates/configmap-symbolicator.yaml @@ -9,5 +9,5 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" data: - config.yml: {{ toYaml .Values.symbolicator.api.config | indent 2 }} + {{ include "sentry.symbolicator.config" . | nindent 2 }} {{- end }} diff --git a/sentry/templates/cronjob-sentry-cleanup.yaml b/sentry/templates/cronjob-sentry-cleanup.yaml index 3c26abae0..fbb2ecd86 100644 --- a/sentry/templates/cronjob-sentry-cleanup.yaml +++ b/sentry/templates/cronjob-sentry-cleanup.yaml @@ -24,7 +24,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.cleanup.annotations }} {{ toYaml .Values.sentry.cleanup.annotations | indent 12 }} {{- end }} diff --git a/sentry/templates/deployment-metrics.yaml b/sentry/templates/deployment-metrics.yaml index afcc41757..9c3434243 100644 --- a/sentry/templates/deployment-metrics.yaml +++ b/sentry/templates/deployment-metrics.yaml @@ -21,7 +21,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.metrics.podAnnotations }} {{ toYaml .Values.metrics.podAnnotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-relay.yaml b/sentry/templates/deployment-relay.yaml index 55df49e4a..91aaa3e45 100644 --- a/sentry/templates/deployment-relay.yaml +++ b/sentry/templates/deployment-relay.yaml @@ -31,7 +31,7 @@ spec: metadata: annotations: checksum/relay: {{ .Values.config.relay | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-relay.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.relay.config" . | sha256sum }} {{- if .Values.relay.annotations }} {{ toYaml .Values.relay.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-billing-metrics-consumer.yaml b/sentry/templates/deployment-sentry-billing-metrics-consumer.yaml index 5c65fc0e0..4bb5717ac 100644 --- a/sentry/templates/deployment-sentry-billing-metrics-consumer.yaml +++ b/sentry/templates/deployment-sentry-billing-metrics-consumer.yaml @@ -32,7 +32,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.billingMetricsConsumer.annotations }} {{ toYaml .Values.sentry.billingMetricsConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-cron.yaml b/sentry/templates/deployment-sentry-cron.yaml index 62d66e52b..aea09e14f 100644 --- a/sentry/templates/deployment-sentry-cron.yaml +++ b/sentry/templates/deployment-sentry-cron.yaml @@ -21,7 +21,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.cron.annotations }} {{ toYaml .Values.sentry.cron.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-generic-metrics-consumer.yaml b/sentry/templates/deployment-sentry-generic-metrics-consumer.yaml index 2c91ed8db..1f9393beb 100644 --- a/sentry/templates/deployment-sentry-generic-metrics-consumer.yaml +++ b/sentry/templates/deployment-sentry-generic-metrics-consumer.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.genericMetricsConsumer.annotations }} {{ toYaml .Values.sentry.genericMetricsConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml b/sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml index 985e263ac..16a47ff0b 100644 --- a/sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml +++ b/sentry/templates/deployment-sentry-ingest-consumer-attachments.yaml @@ -32,7 +32,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.ingestConsumer.annotations }} {{ toYaml .Values.sentry.ingestConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-ingest-consumer-events.yaml b/sentry/templates/deployment-sentry-ingest-consumer-events.yaml index 1092e11ef..ab6b9c5f8 100644 --- a/sentry/templates/deployment-sentry-ingest-consumer-events.yaml +++ b/sentry/templates/deployment-sentry-ingest-consumer-events.yaml @@ -32,7 +32,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.ingestConsumer.annotations }} {{ toYaml .Values.sentry.ingestConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-ingest-consumer-transactions.yaml b/sentry/templates/deployment-sentry-ingest-consumer-transactions.yaml index 85635ec3d..50423bf84 100644 --- a/sentry/templates/deployment-sentry-ingest-consumer-transactions.yaml +++ b/sentry/templates/deployment-sentry-ingest-consumer-transactions.yaml @@ -32,7 +32,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.ingestConsumer.annotations }} {{ toYaml .Values.sentry.ingestConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-ingest-monitors.yaml b/sentry/templates/deployment-sentry-ingest-monitors.yaml index 19e6e5176..842d07425 100644 --- a/sentry/templates/deployment-sentry-ingest-monitors.yaml +++ b/sentry/templates/deployment-sentry-ingest-monitors.yaml @@ -32,7 +32,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.ingestMonitors.annotations }} {{ toYaml .Values.sentry.ingestMonitors.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-ingest-occurrences.yaml b/sentry/templates/deployment-sentry-ingest-occurrences.yaml index 14f94fe91..5c9d72c49 100644 --- a/sentry/templates/deployment-sentry-ingest-occurrences.yaml +++ b/sentry/templates/deployment-sentry-ingest-occurrences.yaml @@ -32,7 +32,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.ingestOccurrences.annotations }} {{ toYaml .Values.sentry.ingestOccurrences.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-ingest-profiles.yaml b/sentry/templates/deployment-sentry-ingest-profiles.yaml index f8a44282a..7ffb14986 100644 --- a/sentry/templates/deployment-sentry-ingest-profiles.yaml +++ b/sentry/templates/deployment-sentry-ingest-profiles.yaml @@ -32,7 +32,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.ingestProfiles.annotations }} {{ toYaml .Values.sentry.ingestProfiles.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-ingest-replay-recordings.yaml b/sentry/templates/deployment-sentry-ingest-replay-recordings.yaml index 5403a943d..310a8a07c 100644 --- a/sentry/templates/deployment-sentry-ingest-replay-recordings.yaml +++ b/sentry/templates/deployment-sentry-ingest-replay-recordings.yaml @@ -32,7 +32,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.ingestReplayRecordings.annotations }} {{ toYaml .Values.sentry.ingestReplayRecordings.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-metrics-consumer.yaml b/sentry/templates/deployment-sentry-metrics-consumer.yaml index 9db78f2e4..fa58ab706 100644 --- a/sentry/templates/deployment-sentry-metrics-consumer.yaml +++ b/sentry/templates/deployment-sentry-metrics-consumer.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.metricsConsumer.annotations }} {{ toYaml .Values.sentry.metricsConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-post-process-forwarder-errors.yaml b/sentry/templates/deployment-sentry-post-process-forwarder-errors.yaml index 0dca18b12..4334c130d 100644 --- a/sentry/templates/deployment-sentry-post-process-forwarder-errors.yaml +++ b/sentry/templates/deployment-sentry-post-process-forwarder-errors.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.postProcessForwardErrors.annotations }} {{ toYaml .Values.sentry.postProcessForwardErrors.annotations | indent 8 }} {{- end }} @@ -76,7 +76,7 @@ spec: command: ["sentry"] args: - "run" - - "consumer" + - "consumer" - "post-process-forwarder-errors" - "--consumer-group" - "post-process-forwarder" diff --git a/sentry/templates/deployment-sentry-post-process-forwarder-issue-platform.yaml b/sentry/templates/deployment-sentry-post-process-forwarder-issue-platform.yaml index a1786c11b..c7ab7f18b 100644 --- a/sentry/templates/deployment-sentry-post-process-forwarder-issue-platform.yaml +++ b/sentry/templates/deployment-sentry-post-process-forwarder-issue-platform.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.postProcessForwardIssuePlatform.annotations }} {{ toYaml .Values.sentry.postProcessForwardIssuePlatform.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-post-process-forwarder-transactions.yaml b/sentry/templates/deployment-sentry-post-process-forwarder-transactions.yaml index 7d34a277a..422a6ceb8 100644 --- a/sentry/templates/deployment-sentry-post-process-forwarder-transactions.yaml +++ b/sentry/templates/deployment-sentry-post-process-forwarder-transactions.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.postProcessForwardTransactions.annotations }} {{ toYaml .Values.sentry.postProcessForwardTransactions.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-subscription-consumer-events.yaml b/sentry/templates/deployment-sentry-subscription-consumer-events.yaml index fc6058442..963380eb8 100644 --- a/sentry/templates/deployment-sentry-subscription-consumer-events.yaml +++ b/sentry/templates/deployment-sentry-subscription-consumer-events.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.subscriptionConsumerEvents.annotations }} {{ toYaml .Values.sentry.subscriptionConsumerEvents.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-subscription-consumer-generic-metrics.yaml b/sentry/templates/deployment-sentry-subscription-consumer-generic-metrics.yaml index 42eaca4f5..e91189340 100644 --- a/sentry/templates/deployment-sentry-subscription-consumer-generic-metrics.yaml +++ b/sentry/templates/deployment-sentry-subscription-consumer-generic-metrics.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.subscriptionConsumerGenericMetrics.annotations }} {{ toYaml .Values.sentry.subscriptionConsumerGenericMetrics.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-subscription-consumer-metrics.yaml b/sentry/templates/deployment-sentry-subscription-consumer-metrics.yaml index 28427f3d2..adbca8153 100644 --- a/sentry/templates/deployment-sentry-subscription-consumer-metrics.yaml +++ b/sentry/templates/deployment-sentry-subscription-consumer-metrics.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.subscriptionConsumerMetrics.annotations }} {{ toYaml .Values.sentry.subscriptionConsumerMetrics.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-subscription-consumer-transactions.yaml b/sentry/templates/deployment-sentry-subscription-consumer-transactions.yaml index 3aed9683f..d34887fc1 100644 --- a/sentry/templates/deployment-sentry-subscription-consumer-transactions.yaml +++ b/sentry/templates/deployment-sentry-subscription-consumer-transactions.yaml @@ -30,7 +30,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.subscriptionConsumerTransactions.annotations }} {{ toYaml .Values.sentry.subscriptionConsumerTransactions.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-web.yaml b/sentry/templates/deployment-sentry-web.yaml index 0e8449913..6d993a343 100644 --- a/sentry/templates/deployment-sentry-web.yaml +++ b/sentry/templates/deployment-sentry-web.yaml @@ -25,7 +25,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.web.annotations }} {{ toYaml .Values.sentry.web.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-sentry-worker.yaml b/sentry/templates/deployment-sentry-worker.yaml index 7827af621..bc1f74562 100644 --- a/sentry/templates/deployment-sentry-worker.yaml +++ b/sentry/templates/deployment-sentry-worker.yaml @@ -23,7 +23,7 @@ spec: annotations: checksum/configYml: {{ .Values.config.configYml | toYaml | toString | sha256sum }} checksum/sentryConfPy: {{ .Values.config.sentryConfPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.worker.annotations }} {{ toYaml .Values.sentry.worker.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-api.yaml b/sentry/templates/deployment-snuba-api.yaml index 7c239cd65..52d7b840e 100644 --- a/sentry/templates/deployment-snuba-api.yaml +++ b/sentry/templates/deployment-snuba-api.yaml @@ -22,7 +22,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.api.annotations }} {{ toYaml .Values.snuba.api.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-consumer.yaml b/sentry/templates/deployment-snuba-consumer.yaml index 02c79a164..e9ea7692e 100644 --- a/sentry/templates/deployment-snuba-consumer.yaml +++ b/sentry/templates/deployment-snuba-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.consumer.annotations }} {{ toYaml .Values.snuba.consumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-generic-metrics-counters-consumer.yaml b/sentry/templates/deployment-snuba-generic-metrics-counters-consumer.yaml index e26b8bd78..913d4bce9 100644 --- a/sentry/templates/deployment-snuba-generic-metrics-counters-consumer.yaml +++ b/sentry/templates/deployment-snuba-generic-metrics-counters-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.genericMetricsCountersConsumer.annotations }} {{ toYaml .Values.snuba.genericMetricsCountersConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-generic-metrics-distributions-consumer.yaml b/sentry/templates/deployment-snuba-generic-metrics-distributions-consumer.yaml index 44838711e..3d625963e 100644 --- a/sentry/templates/deployment-snuba-generic-metrics-distributions-consumer.yaml +++ b/sentry/templates/deployment-snuba-generic-metrics-distributions-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.genericMetricsDistributionConsumer.annotations }} {{ toYaml .Values.snuba.genericMetricsDistributionConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-generic-metrics-sets-consumer.yaml b/sentry/templates/deployment-snuba-generic-metrics-sets-consumer.yaml index d7c67c812..ea9f94e45 100644 --- a/sentry/templates/deployment-snuba-generic-metrics-sets-consumer.yaml +++ b/sentry/templates/deployment-snuba-generic-metrics-sets-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.genericMetricsSetsConsumer.annotations }} {{ toYaml .Values.snuba.genericMetricsSetsConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-issue-occurrence-consumer.yaml b/sentry/templates/deployment-snuba-issue-occurrence-consumer.yaml index 2b354f298..003d221da 100644 --- a/sentry/templates/deployment-snuba-issue-occurrence-consumer.yaml +++ b/sentry/templates/deployment-snuba-issue-occurrence-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.issueOccurrenceConsumer.annotations }} {{ toYaml .Values.snuba.issueOccurrenceConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-metrics-consumer.yaml b/sentry/templates/deployment-snuba-metrics-consumer.yaml index c917100de..48adab680 100644 --- a/sentry/templates/deployment-snuba-metrics-consumer.yaml +++ b/sentry/templates/deployment-snuba-metrics-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.metricsConsumer.annotations }} {{ toYaml .Values.snuba.metricsConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-outcomes-consumer.yaml b/sentry/templates/deployment-snuba-outcomes-consumer.yaml index fa2d8998c..3771bca55 100644 --- a/sentry/templates/deployment-snuba-outcomes-consumer.yaml +++ b/sentry/templates/deployment-snuba-outcomes-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.outcomesConsumer.annotations }} {{ toYaml .Values.snuba.outcomesConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-profiling-functions-consumer.yaml b/sentry/templates/deployment-snuba-profiling-functions-consumer.yaml index e9e20713c..978230f63 100644 --- a/sentry/templates/deployment-snuba-profiling-functions-consumer.yaml +++ b/sentry/templates/deployment-snuba-profiling-functions-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.profilingFunctionsConsumer.annotations }} {{ toYaml .Values.snuba.profilingFunctionsConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-profiling-profiles-consumer.yaml b/sentry/templates/deployment-snuba-profiling-profiles-consumer.yaml index 48e5aae62..3ef541c95 100644 --- a/sentry/templates/deployment-snuba-profiling-profiles-consumer.yaml +++ b/sentry/templates/deployment-snuba-profiling-profiles-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.profilingProfilesConsumer.annotations }} {{ toYaml .Values.snuba.profilingProfilesConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-replacer.yaml b/sentry/templates/deployment-snuba-replacer.yaml index 56ae40174..671994f0e 100644 --- a/sentry/templates/deployment-snuba-replacer.yaml +++ b/sentry/templates/deployment-snuba-replacer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.replacer.annotations }} {{ toYaml .Values.snuba.replacer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-replays-consumer.yaml b/sentry/templates/deployment-snuba-replays-consumer.yaml index b05feda83..163ae0886 100644 --- a/sentry/templates/deployment-snuba-replays-consumer.yaml +++ b/sentry/templates/deployment-snuba-replays-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.replaysConsumer.annotations }} {{ toYaml .Values.snuba.replaysConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-subscription-consumer-events.yaml b/sentry/templates/deployment-snuba-subscription-consumer-events.yaml index 641e61940..3402b3f69 100644 --- a/sentry/templates/deployment-snuba-subscription-consumer-events.yaml +++ b/sentry/templates/deployment-snuba-subscription-consumer-events.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.subscriptionConsumerEvents.annotations }} {{ toYaml .Values.snuba.subscriptionConsumerEvents.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-subscription-consumer-metrics.yaml b/sentry/templates/deployment-snuba-subscription-consumer-metrics.yaml index d1699c298..851ea832f 100644 --- a/sentry/templates/deployment-snuba-subscription-consumer-metrics.yaml +++ b/sentry/templates/deployment-snuba-subscription-consumer-metrics.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.subscriptionConsumerMetrics.annotations }} {{ toYaml .Values.snuba.subscriptionConsumerMetrics.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-subscription-consumer-transactions.yaml b/sentry/templates/deployment-snuba-subscription-consumer-transactions.yaml index 2c8ad536d..4a940fc05 100644 --- a/sentry/templates/deployment-snuba-subscription-consumer-transactions.yaml +++ b/sentry/templates/deployment-snuba-subscription-consumer-transactions.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.subscriptionConsumerTransactions.annotations }} {{ toYaml .Values.snuba.subscriptionConsumerTransactions.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-snuba-transactions-consumer.yaml b/sentry/templates/deployment-snuba-transactions-consumer.yaml index 00c56a26f..f9c7f8a3c 100644 --- a/sentry/templates/deployment-snuba-transactions-consumer.yaml +++ b/sentry/templates/deployment-snuba-transactions-consumer.yaml @@ -29,7 +29,7 @@ spec: metadata: annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.transactionsConsumer.annotations }} {{ toYaml .Values.snuba.transactionsConsumer.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/deployment-symbolicator.yaml b/sentry/templates/deployment-symbolicator.yaml index a0ccacb38..9b1ff7d66 100644 --- a/sentry/templates/deployment-symbolicator.yaml +++ b/sentry/templates/deployment-symbolicator.yaml @@ -21,7 +21,7 @@ spec: template: metadata: annotations: - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-symbolicator.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.symbolicator.config" . | sha256sum }} {{- if .Values.symbolicator.api.annotations }} {{ toYaml .Values.symbolicator.api.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/hooks/sentry-db-init.job.yaml b/sentry/templates/hooks/sentry-db-init.job.yaml index 1f201bae7..a3ce9f1e9 100644 --- a/sentry/templates/hooks/sentry-db-init.job.yaml +++ b/sentry/templates/hooks/sentry-db-init.job.yaml @@ -22,7 +22,7 @@ spec: metadata: name: {{ template "sentry.fullname" . }}-db-init annotations: - checksum/configmap.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/configmap.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.worker.annotations }} {{ toYaml .Values.sentry.worker.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/hooks/snuba-db-init.job.yaml b/sentry/templates/hooks/snuba-db-init.job.yaml index 05a7d3fe2..4320bdb2d 100644 --- a/sentry/templates/hooks/snuba-db-init.job.yaml +++ b/sentry/templates/hooks/snuba-db-init.job.yaml @@ -24,7 +24,7 @@ spec: name: {{ template "sentry.fullname" . }}-snuba-db-init annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.annotations }} {{ toYaml .Values.snuba.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/hooks/snuba-migrate.job.yaml b/sentry/templates/hooks/snuba-migrate.job.yaml index 3754804dd..a3a5916a8 100644 --- a/sentry/templates/hooks/snuba-migrate.job.yaml +++ b/sentry/templates/hooks/snuba-migrate.job.yaml @@ -24,7 +24,7 @@ spec: name: {{ template "sentry.fullname" . }}-snuba-migrate annotations: checksum/snubaSettingsPy: {{ .Values.config.snubaSettingsPy | sha256sum }} - checksum/config.yaml: {{ include (print $.Template.BasePath "/configmap-snuba.yaml") . | sha256sum }} + checksum/config.yaml: {{ include "sentry.snuba.config" . | sha256sum }} {{- if .Values.snuba.annotations }} {{ toYaml .Values.snuba.annotations | indent 8 }} {{- end }} diff --git a/sentry/templates/hooks/user-create.yaml b/sentry/templates/hooks/user-create.yaml index fda1247f9..2ab3a7d86 100644 --- a/sentry/templates/hooks/user-create.yaml +++ b/sentry/templates/hooks/user-create.yaml @@ -20,7 +20,7 @@ spec: metadata: name: {{ template "sentry.fullname" . }}-user-create annotations: - checksum/configmap.yaml: {{ include (print $.Template.BasePath "/configmap-sentry.yaml") . | sha256sum }} + checksum/configmap.yaml: {{ include "sentry.config" . | sha256sum }} {{- if .Values.sentry.worker.annotations }} {{ toYaml .Values.sentry.worker.annotations | indent 8 }} {{- end }}