From 1cf5e06496433f5b3e3c9c73784ab7f29a727add Mon Sep 17 00:00:00 2001 From: labuladong Date: Fri, 24 Jan 2025 14:57:06 +0800 Subject: [PATCH] fix --- .../sn-platform-slim/ci/disable-auth-values.yaml | 3 +++ .../templates/bookkeeper/_autorecovery.tpl | 14 +++++++------- .../templates/bookkeeper/_bookkeeper.tpl | 2 +- .../templates/broker/_broker.tpl | 2 +- .../templates/prometheus/_prometheus.tpl | 2 +- .../sn-platform-slim/templates/proxy/_proxy.tpl | 16 ++++++++-------- .../templates/zookeeper/_zookeeper.tpl | 2 +- .../ci/disable-monitoring-values.yaml | 4 ++-- .../templates/bookkeeper/_autorecovery.tpl | 16 ++++++++-------- .../templates/bookkeeper/_bookkeeper.tpl | 2 +- charts/sn-platform/templates/broker/_broker.tpl | 2 +- .../templates/prometheus/_prometheus.tpl | 2 +- charts/sn-platform/templates/proxy/_proxy.tpl | 16 ++++++++-------- charts/sn-platform/templates/vault/_vault.tpl | 4 ++-- .../templates/zookeeper/_zookeeper.tpl | 2 +- charts/sn-platform/values.yaml | 12 ++++++------ 16 files changed, 52 insertions(+), 49 deletions(-) diff --git a/charts/sn-platform-slim/ci/disable-auth-values.yaml b/charts/sn-platform-slim/ci/disable-auth-values.yaml index c300a72d8..9c25c5149 100644 --- a/charts/sn-platform-slim/ci/disable-auth-values.yaml +++ b/charts/sn-platform-slim/ci/disable-auth-values.yaml @@ -8,3 +8,6 @@ auth: enabled: false authorization: enabled: false +proxy: + authenticateMetricsEndpoint: + enabled: false \ No newline at end of file diff --git a/charts/sn-platform-slim/templates/bookkeeper/_autorecovery.tpl b/charts/sn-platform-slim/templates/bookkeeper/_autorecovery.tpl index 5d2a11831..e59a77b7d 100644 --- a/charts/sn-platform-slim/templates/bookkeeper/_autorecovery.tpl +++ b/charts/sn-platform-slim/templates/bookkeeper/_autorecovery.tpl @@ -13,7 +13,7 @@ ${HOSTNAME}.{{ template "pulsar.autorecovery.service" . }}.{{ template "pulsar.n {{- end -}} {{/*Define broker autorecovery name*/}} -{{- define "pulsar.autorecovery.podName" -}} +{{- define "pulsar.autorecovery.containerName" -}} {{- print "autorecovery" -}} {{- end -}} @@ -21,11 +21,11 @@ ${HOSTNAME}.{{ template "pulsar.autorecovery.service" . }}.{{ template "pulsar.n {{- define "pulsar.autorecovery.datadog.annotation" -}} {{- if .Values.datadog.components.autorecovery.enabled }} {{- if eq .Values.datadog.adVersion "v1" }} -ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.check_names: | +ad.datadoghq.com/{{ template "pulsar.autorecovery.containerName" . }}.check_names: | ["openmetrics"] -ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.init_configs: | - [{}] -ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.instances: | +ad.datadoghq.com/{{ template "pulsar.autorecovery.containerName" . }}.init_configs: | + {} +ad.datadoghq.com/{{ template "pulsar.autorecovery.containerName" . }}.instances: | [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.autorecovery.ports.http }}/metrics", @@ -44,10 +44,10 @@ ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.instances: | ] {{- end }} {{- if eq .Values.datadog.adVersion "v2" }} -ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.checks: | +ad.datadoghq.com/{{ template "pulsar.autorecovery.containerName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.autorecovery.ports.http }}/metrics", diff --git a/charts/sn-platform-slim/templates/bookkeeper/_bookkeeper.tpl b/charts/sn-platform-slim/templates/bookkeeper/_bookkeeper.tpl index 448b338bb..4c8af1265 100644 --- a/charts/sn-platform-slim/templates/bookkeeper/_bookkeeper.tpl +++ b/charts/sn-platform-slim/templates/bookkeeper/_bookkeeper.tpl @@ -197,7 +197,7 @@ ad.datadoghq.com/{{ template "pulsar.bookkeeper.podName" . }}.instances: | ad.datadoghq.com/{{ template "pulsar.bookkeeper.podName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.bookkeeper.ports.http }}/metrics", diff --git a/charts/sn-platform-slim/templates/broker/_broker.tpl b/charts/sn-platform-slim/templates/broker/_broker.tpl index 0702d9d5f..36a3e047d 100644 --- a/charts/sn-platform-slim/templates/broker/_broker.tpl +++ b/charts/sn-platform-slim/templates/broker/_broker.tpl @@ -199,7 +199,7 @@ ad.datadoghq.com/{{ template "pulsar.broker.podName" . }}.instances: | ad.datadoghq.com/{{ template "pulsar.broker.podName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.broker.ports.http }}/metrics", diff --git a/charts/sn-platform-slim/templates/prometheus/_prometheus.tpl b/charts/sn-platform-slim/templates/prometheus/_prometheus.tpl index 9305b8c7f..e2513d03c 100644 --- a/charts/sn-platform-slim/templates/prometheus/_prometheus.tpl +++ b/charts/sn-platform-slim/templates/prometheus/_prometheus.tpl @@ -67,7 +67,7 @@ ad.datadoghq.com/{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.compon ad.datadoghq.com/{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.prometheus.port }}/federate?match[]=%7B__name__%3D~%22pulsar_.%2B%7Cjvm_.%2B%7Ctopic_.%2B%22%7D", diff --git a/charts/sn-platform-slim/templates/proxy/_proxy.tpl b/charts/sn-platform-slim/templates/proxy/_proxy.tpl index 0eb638f85..934accfab 100644 --- a/charts/sn-platform-slim/templates/proxy/_proxy.tpl +++ b/charts/sn-platform-slim/templates/proxy/_proxy.tpl @@ -96,7 +96,7 @@ Define proxy log volumes {{- end }} {{/*Define proxy pod name*/}} -{{- define "pulsar.proxy.podName" -}} +{{- define "pulsar.proxy.containerName" -}} {{- print "pulsar-proxy" -}} {{- end -}} @@ -106,11 +106,11 @@ Define proxy datadog annotation {{- define "pulsar.proxy.datadog.annotation" -}} {{- if .Values.datadog.components.proxy.enabled }} {{- if eq .Values.datadog.adVersion "v1" }} -ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.check_names: | +ad.datadoghq.com/{{ template "pulsar.proxy.containerName" . }}.check_names: | ["openmetrics"] -ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.init_configs: | +ad.datadoghq.com/{{ template "pulsar.proxy.containerName" . }}.init_configs: | [{}] -ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.instances: | +ad.datadoghq.com/{{ template "pulsar.proxy.containerName" . }}.instances: | [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.proxy.ports.http }}/metrics/", @@ -123,7 +123,7 @@ ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.instances: | "enable_health_service_check": true, "timeout": 1000, {{- if .Values.auth.authentication.enabled }} -{{- if eq .Values.auth.authentication.provider "jwt" }} +{{- if eq .Values.auth.authentication.provider "jwt" and .Values.proxy.authenticateMetricsEndpoint.enabled }} "extra_headers": { "Authorization": "Bearer %%env_PROXY_TOKEN%%" }, @@ -136,10 +136,10 @@ ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.instances: | ] {{- end }} {{- if eq .Values.datadog.adVersion "v2" }} -ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.checks: | +ad.datadoghq.com/{{ template "pulsar.proxy.containerName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.proxy.ports.http }}/metrics/", @@ -152,7 +152,7 @@ ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.checks: | "enable_health_service_check": true, "timeout": 1000, {{- if .Values.auth.authentication.enabled }} -{{- if eq .Values.auth.authentication.provider "jwt" }} +{{- if eq .Values.auth.authentication.provider "jwt" and .Values.proxy.authenticateMetricsEndpoint.enabled }} "extra_headers": { "Authorization": "Bearer %%env_PROXY_TOKEN%%" }, diff --git a/charts/sn-platform-slim/templates/zookeeper/_zookeeper.tpl b/charts/sn-platform-slim/templates/zookeeper/_zookeeper.tpl index 6d46d1b59..3a74407b8 100644 --- a/charts/sn-platform-slim/templates/zookeeper/_zookeeper.tpl +++ b/charts/sn-platform-slim/templates/zookeeper/_zookeeper.tpl @@ -146,7 +146,7 @@ ad.datadoghq.com/{{ template "pulsar.zookeeper.podName" . }}.instances: | ad.datadoghq.com/{{ template "pulsar.zookeeper.podName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.zookeeper.ports.metrics }}/metrics", diff --git a/charts/sn-platform/ci/disable-monitoring-values.yaml b/charts/sn-platform/ci/disable-monitoring-values.yaml index 92208e849..cc12bd32e 100644 --- a/charts/sn-platform/ci/disable-monitoring-values.yaml +++ b/charts/sn-platform/ci/disable-monitoring-values.yaml @@ -4,9 +4,9 @@ # Based on the defult values, disable the monitoring components monitoring: - prometheus: false + prometheus: true grafana: false node_exporter: false alert_manager: false loki: false - datadog: false + datadog: true diff --git a/charts/sn-platform/templates/bookkeeper/_autorecovery.tpl b/charts/sn-platform/templates/bookkeeper/_autorecovery.tpl index 646c71568..acd686ed1 100644 --- a/charts/sn-platform/templates/bookkeeper/_autorecovery.tpl +++ b/charts/sn-platform/templates/bookkeeper/_autorecovery.tpl @@ -13,19 +13,19 @@ ${HOSTNAME}.{{ template "pulsar.autorecovery.service" . }}.{{ template "pulsar.n {{- end -}} {{/*Define broker autorecovery name*/}} -{{- define "pulsar.autorecovery.podName" -}} -{{- print "autorecovery" -}} +{{- define "pulsar.autorecovery.containerName" -}} +{{- print "bookie-recovery" -}} {{- end -}} {{/*Define autorecovery datadog annotation*/}} {{- define "pulsar.autorecovery.datadog.annotation" -}} {{- if .Values.datadog.components.autorecovery.enabled }} {{- if eq .Values.datadog.adVersion "v1" }} -ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.check_names: | +ad.datadoghq.com/{{ template "pulsar.autorecovery.containerName" . }}.check_names: | ["openmetrics"] -ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.init_configs: | - [{}] -ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.instances: | +ad.datadoghq.com/{{ template "pulsar.autorecovery.containerName" . }}.init_configs: | + {} +ad.datadoghq.com/{{ template "pulsar.autorecovery.containerName" . }}.instances: | [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.autorecovery.ports.http }}/metrics", @@ -44,10 +44,10 @@ ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.instances: | ] {{- end }} {{- if eq .Values.datadog.adVersion "v2" }} -ad.datadoghq.com/{{ template "pulsar.autorecovery.podName" . }}.checks: | +ad.datadoghq.com/{{ template "pulsar.autorecovery.containerName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.autorecovery.ports.http }}/metrics", diff --git a/charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl b/charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl index 448b338bb..4c8af1265 100644 --- a/charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl +++ b/charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl @@ -197,7 +197,7 @@ ad.datadoghq.com/{{ template "pulsar.bookkeeper.podName" . }}.instances: | ad.datadoghq.com/{{ template "pulsar.bookkeeper.podName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.bookkeeper.ports.http }}/metrics", diff --git a/charts/sn-platform/templates/broker/_broker.tpl b/charts/sn-platform/templates/broker/_broker.tpl index 0702d9d5f..36a3e047d 100644 --- a/charts/sn-platform/templates/broker/_broker.tpl +++ b/charts/sn-platform/templates/broker/_broker.tpl @@ -199,7 +199,7 @@ ad.datadoghq.com/{{ template "pulsar.broker.podName" . }}.instances: | ad.datadoghq.com/{{ template "pulsar.broker.podName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.broker.ports.http }}/metrics", diff --git a/charts/sn-platform/templates/prometheus/_prometheus.tpl b/charts/sn-platform/templates/prometheus/_prometheus.tpl index 9305b8c7f..e2513d03c 100644 --- a/charts/sn-platform/templates/prometheus/_prometheus.tpl +++ b/charts/sn-platform/templates/prometheus/_prometheus.tpl @@ -67,7 +67,7 @@ ad.datadoghq.com/{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.compon ad.datadoghq.com/{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.prometheus.port }}/federate?match[]=%7B__name__%3D~%22pulsar_.%2B%7Cjvm_.%2B%7Ctopic_.%2B%22%7D", diff --git a/charts/sn-platform/templates/proxy/_proxy.tpl b/charts/sn-platform/templates/proxy/_proxy.tpl index 0eb638f85..934accfab 100644 --- a/charts/sn-platform/templates/proxy/_proxy.tpl +++ b/charts/sn-platform/templates/proxy/_proxy.tpl @@ -96,7 +96,7 @@ Define proxy log volumes {{- end }} {{/*Define proxy pod name*/}} -{{- define "pulsar.proxy.podName" -}} +{{- define "pulsar.proxy.containerName" -}} {{- print "pulsar-proxy" -}} {{- end -}} @@ -106,11 +106,11 @@ Define proxy datadog annotation {{- define "pulsar.proxy.datadog.annotation" -}} {{- if .Values.datadog.components.proxy.enabled }} {{- if eq .Values.datadog.adVersion "v1" }} -ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.check_names: | +ad.datadoghq.com/{{ template "pulsar.proxy.containerName" . }}.check_names: | ["openmetrics"] -ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.init_configs: | +ad.datadoghq.com/{{ template "pulsar.proxy.containerName" . }}.init_configs: | [{}] -ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.instances: | +ad.datadoghq.com/{{ template "pulsar.proxy.containerName" . }}.instances: | [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.proxy.ports.http }}/metrics/", @@ -123,7 +123,7 @@ ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.instances: | "enable_health_service_check": true, "timeout": 1000, {{- if .Values.auth.authentication.enabled }} -{{- if eq .Values.auth.authentication.provider "jwt" }} +{{- if eq .Values.auth.authentication.provider "jwt" and .Values.proxy.authenticateMetricsEndpoint.enabled }} "extra_headers": { "Authorization": "Bearer %%env_PROXY_TOKEN%%" }, @@ -136,10 +136,10 @@ ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.instances: | ] {{- end }} {{- if eq .Values.datadog.adVersion "v2" }} -ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.checks: | +ad.datadoghq.com/{{ template "pulsar.proxy.containerName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.proxy.ports.http }}/metrics/", @@ -152,7 +152,7 @@ ad.datadoghq.com/{{ template "pulsar.proxy.podName" . }}.checks: | "enable_health_service_check": true, "timeout": 1000, {{- if .Values.auth.authentication.enabled }} -{{- if eq .Values.auth.authentication.provider "jwt" }} +{{- if eq .Values.auth.authentication.provider "jwt" and .Values.proxy.authenticateMetricsEndpoint.enabled }} "extra_headers": { "Authorization": "Bearer %%env_PROXY_TOKEN%%" }, diff --git a/charts/sn-platform/templates/vault/_vault.tpl b/charts/sn-platform/templates/vault/_vault.tpl index 47e250b72..134bb9443 100644 --- a/charts/sn-platform/templates/vault/_vault.tpl +++ b/charts/sn-platform/templates/vault/_vault.tpl @@ -50,8 +50,8 @@ ad.datadoghq.com/vault.instances: | {{- if eq .Values.datadog.adVersion "v2" }} ad.datadoghq.com/vault.checks: | { - "openmetrics": { - "init_config": [{}], + "vault": { + "init_config": {}, "instances": [ { "api_url": "http://%%host%%:8200/v1", diff --git a/charts/sn-platform/templates/zookeeper/_zookeeper.tpl b/charts/sn-platform/templates/zookeeper/_zookeeper.tpl index 6d46d1b59..3a74407b8 100644 --- a/charts/sn-platform/templates/zookeeper/_zookeeper.tpl +++ b/charts/sn-platform/templates/zookeeper/_zookeeper.tpl @@ -146,7 +146,7 @@ ad.datadoghq.com/{{ template "pulsar.zookeeper.podName" . }}.instances: | ad.datadoghq.com/{{ template "pulsar.zookeeper.podName" . }}.checks: | { "openmetrics": { - "init_config": [{}], + "init_config": {}, "instances": [ { "openmetrics_endpoint": "http://%%host%%:{{ .Values.zookeeper.ports.metrics }}/metrics", diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index a7623d232..4ae9703b5 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -102,15 +102,15 @@ monitoring: # monitoring - prometheus prometheus: true # monitoring - grafana - grafana: true + grafana: false # monitoring - node_exporter node_exporter: true # alerting - alert-manager - alert_manager: true + alert_manager: false # monitoring - loki loki: false # monitoring - datadog - datadog: false + datadog: true ## Images ## @@ -1871,7 +1871,7 @@ datadog: namespace: ## Datadog Autodiscovery version, support v1 and v2. ## https://docs.datadoghq.com/getting_started/containers/autodiscovery/?tab=adannotationsv2agent736 - adVersion: v1 + adVersion: v2 components: zookeeper: enabled: false @@ -1879,7 +1879,7 @@ datadog: "\".*\"" ] bookkeeper: - enabled: false + enabled: true metrics: [ "\".*\"" ] @@ -1899,7 +1899,7 @@ datadog: "\".*\"" ] vault: - enabled: false + enabled: true auth: enabled: false token: ""