Skip to content

Commit 1ce32ab

Browse files
authored
feat: add distributed cluster name config (#1780)
* feat: add distributed cluster name helper function Add new helper function sentry.clickhouse.distributed.cluster.name that allows separate configuration of distributed cluster name for external ClickHouse. - Maintains backward compatibility (defaults to clusterName) - Enables advanced ClickHouse cluster configurations * feat: use separate helper for distributed cluster name Update Snuba configuration to use the new distributed cluster name helper * docs: add distributedClusterName documentation in values.yaml Add documentation and example for the new distributedClusterName option
1 parent 3f29825 commit 1ce32ab

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

charts/sentry/templates/_helper.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,17 @@ Set ClickHouse cluster name
412412
{{- end -}}
413413
{{- end -}}
414414

415+
{{/*
416+
Set ClickHouse distributed cluster name
417+
*/}}
418+
{{- define "sentry.clickhouse.distributed.cluster.name" -}}
419+
{{- if .Values.clickhouse.enabled -}}
420+
{{ .Release.Name | printf "%s-clickhouse" }}
421+
{{- else -}}
422+
{{ default .Values.externalClickhouse.clusterName .Values.externalClickhouse.distributedClusterName }}
423+
{{- end -}}
424+
{{- end -}}
425+
415426
{{/*
416427
Set ClickHouse secure setting
417428
*/}}

charts/sentry/templates/snuba/_helper-snuba.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ settings.py: |
8181
{{- end }}
8282
{{- if or .Values.clickhouse.enabled (not .Values.externalClickhouse.singleNode) }}
8383
"cluster_name": {{ include "sentry.clickhouse.cluster.name" . | quote }},
84-
"distributed_cluster_name": {{ include "sentry.clickhouse.cluster.name" . | quote }},
84+
"distributed_cluster_name": {{ include "sentry.clickhouse.distributed.cluster.name" . | quote }},
8585
{{- end }}
8686
},
8787
]

charts/sentry/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,6 +2268,10 @@ externalClickhouse:
22682268
## or by executing `select * from system.clusters`
22692269
##
22702270
# clusterName: test_shard_localhost
2271+
## Optional: separate distributed cluster name (defaults to clusterName)
2272+
## Use this when your ClickHouse distributed queries need a different cluster name
2273+
##
2274+
# distributedClusterName: distributed_test_shard_localhost
22712275

22722276
# Settings for Zookeeper.
22732277
# See https://github.com/bitnami/charts/tree/master/bitnami/zookeeper

0 commit comments

Comments
 (0)