diff --git a/.changeset/expose-table-ttl.md b/.changeset/expose-table-ttl.md new file mode 100644 index 00000000..cc7d9ae2 --- /dev/null +++ b/.changeset/expose-table-ttl.md @@ -0,0 +1,7 @@ +--- +"helm-charts": minor +--- + +feat(clickstack): surface ClickHouse table TTL as configurable values + +Defaults and documents `HYPERDX_OTEL_EXPORTER_TABLES_TTL` (720h) in `hyperdx.config`, and documents the per-signal overrides (`HYPERDX_OTEL_EXPORTER_LOGS_TTL` / `_TRACES_TTL` / `_METRICS_TTL` / `_SESSIONS_TTL`) plus `HYPERDX_OTEL_EXPORTER_RECONCILE_TABLE_TTL`. Operators can now set ClickHouse data retention per signal — e.g. keep logs and traces for 6 months for compliance while metrics stay short — without hand-crafting collector env vars. The global TTL works today; the per-signal overrides and reconcile require a collector image that includes hyperdxio/hyperdx#2709. diff --git a/charts/clickstack/tests/app-configmap_test.yaml b/charts/clickstack/tests/app-configmap_test.yaml index c088dedd..8145edbb 100644 --- a/charts/clickstack/tests/app-configmap_test.yaml +++ b/charts/clickstack/tests/app-configmap_test.yaml @@ -57,3 +57,23 @@ tests: - matchRegex: path: data.OTEL_EXPORTER_OTLP_ENDPOINT pattern: "http://.*-otel-collector:4318" + + - it: should render the default ClickHouse table TTL + asserts: + - equal: + path: data.HYPERDX_OTEL_EXPORTER_TABLES_TTL + value: "720h" + + - it: should render per-signal TTL and reconcile overrides from config + set: + hyperdx: + config: + HYPERDX_OTEL_EXPORTER_LOGS_TTL: "180d" + HYPERDX_OTEL_EXPORTER_RECONCILE_TABLE_TTL: "true" + asserts: + - equal: + path: data.HYPERDX_OTEL_EXPORTER_LOGS_TTL + value: "180d" + - equal: + path: data.HYPERDX_OTEL_EXPORTER_RECONCILE_TABLE_TTL + value: "true" diff --git a/charts/clickstack/values.yaml b/charts/clickstack/values.yaml index 2dfcb2fe..0044371a 100644 --- a/charts/clickstack/values.yaml +++ b/charts/clickstack/values.yaml @@ -31,6 +31,18 @@ hyperdx: HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE: "default" CLICKHOUSE_USER: "otelcollector" RUN_SCHEDULED_TASKS_EXTERNALLY: "false" + # ClickHouse table retention (TTL). Go-duration string; "d" suffix allowed (e.g. "180d"). + # This global default applies to every signal. + HYPERDX_OTEL_EXPORTER_TABLES_TTL: "720h" + # Per-signal overrides (each falls back to HYPERDX_OTEL_EXPORTER_TABLES_TTL when unset), + # e.g. keep logs & traces longer for compliance while metrics stay short: + # HYPERDX_OTEL_EXPORTER_LOGS_TTL: "180d" + # HYPERDX_OTEL_EXPORTER_TRACES_TTL: "180d" + # HYPERDX_OTEL_EXPORTER_METRICS_TTL: "30d" + # HYPERDX_OTEL_EXPORTER_SESSIONS_TTL: "30d" + # Apply TTL changes to tables that already exist, not just newly created ones (default false): + # HYPERDX_OTEL_EXPORTER_RECONCILE_TABLE_TTL: "true" + # Per-signal TTLs and reconcile require a collector image that includes hyperdxio/hyperdx#2709. # Service endpoint defaults -- override to use external instances FRONTEND_URL: "http://localhost:3000" MONGO_URI: 'mongodb://hyperdx:{{ .Values.hyperdx.secrets.MONGODB_PASSWORD }}@{{ include "clickstack.mongodb.svc" . }}:27017/hyperdx?authSource=hyperdx'