From 84d490e1bfc3bf355d8de4194fe1b0be4480b586 Mon Sep 17 00:00:00 2001 From: Maxim Belyy Date: Tue, 10 Nov 2026 19:43:21 +0700 Subject: [PATCH] feat(observability-proxy): expose the platform namespace prefix in the chart The value is always passed, also when empty, so that clearing it in the values turns the exporter series off instead of falling back to the binary's default. Assisted-by: LLM Signed-off-by: Maxim Belyy --- .../templates/deployment.yaml | 1 + .../tests/deployment_test.yaml | 16 ++++++++++++++++ packages/system/observability-proxy/values.yaml | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/packages/system/observability-proxy/templates/deployment.yaml b/packages/system/observability-proxy/templates/deployment.yaml index d49de140b..c726c4282 100644 --- a/packages/system/observability-proxy/templates/deployment.yaml +++ b/packages/system/observability-proxy/templates/deployment.yaml @@ -41,6 +41,7 @@ spec: - --metrics-shortterm-store={{ .Values.observabilityProxy.metrics.shorttermStore }} - --metrics-longterm-store={{ .Values.observabilityProxy.metrics.longtermStore }} - --metrics-shortterm-retention={{ .Values.observabilityProxy.metrics.shorttermRetention }} + - --metrics-platform-namespace-prefix={{ .Values.observabilityProxy.metrics.platformNamespacePrefix }} ports: - name: http containerPort: 8080 diff --git a/packages/system/observability-proxy/tests/deployment_test.yaml b/packages/system/observability-proxy/tests/deployment_test.yaml index a5e948920..a4c5e760c 100644 --- a/packages/system/observability-proxy/tests/deployment_test.yaml +++ b/packages/system/observability-proxy/tests/deployment_test.yaml @@ -51,6 +51,9 @@ tests: - contains: path: spec.template.spec.containers[0].args content: --metrics-shortterm-retention=72h + - contains: + path: spec.template.spec.containers[0].args + content: --metrics-platform-namespace-prefix=cozy- - it: follows renamed metrics stores set: @@ -69,6 +72,19 @@ tests: path: spec.template.spec.containers[0].args content: --metrics-shortterm-retention=24h + # An empty value must reach the binary as an explicit empty flag; a + # dropped flag would fall back to the cozy- default. + - it: passes an empty platform namespace prefix through + set: + observabilityProxy.metrics.platformNamespacePrefix: "" + asserts: + - contains: + path: spec.template.spec.containers[0].args + content: --metrics-platform-namespace-prefix= + - notContains: + path: spec.template.spec.containers[0].args + content: --metrics-platform-namespace-prefix=cozy- + - it: falls back to cozy.local when the platform passes no cluster domain asserts: - contains: diff --git a/packages/system/observability-proxy/values.yaml b/packages/system/observability-proxy/values.yaml index 67334a237..3199d30bc 100644 --- a/packages/system/observability-proxy/values.yaml +++ b/packages/system/observability-proxy/values.yaml @@ -14,6 +14,10 @@ observabilityProxy: shorttermStore: shortterm longtermStore: longterm shorttermRetention: 72h + # Exporters in namespaces with this prefix may attribute a series to a + # tenant namespace through exported_namespace, and the series is then + # part of that namespace's metrics. Empty disables it. + platformNamespacePrefix: cozy- resources: requests: cpu: 10m