Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
labuladong committed Jan 24, 2025
1 parent aeda6c0 commit 1cf5e06
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 49 deletions.
3 changes: 3 additions & 0 deletions charts/sn-platform-slim/ci/disable-auth-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ auth:
enabled: false
authorization:
enabled: false
proxy:
authenticateMetricsEndpoint:
enabled: false
14 changes: 7 additions & 7 deletions charts/sn-platform-slim/templates/bookkeeper/_autorecovery.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ ${HOSTNAME}.{{ template "pulsar.autorecovery.service" . }}.{{ template "pulsar.n
{{- end -}}

{{/*Define broker autorecovery name*/}}
{{- define "pulsar.autorecovery.podName" -}}
{{- define "pulsar.autorecovery.containerName" -}}
{{- print "autorecovery" -}}
{{- 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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion charts/sn-platform-slim/templates/broker/_broker.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions charts/sn-platform-slim/templates/proxy/_proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

Expand All @@ -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/",
Expand All @@ -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%%"
},
Expand All @@ -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/",
Expand All @@ -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%%"
},
Expand Down
2 changes: 1 addition & 1 deletion charts/sn-platform-slim/templates/zookeeper/_zookeeper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions charts/sn-platform/ci/disable-monitoring-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 8 additions & 8 deletions charts/sn-platform/templates/bookkeeper/_autorecovery.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion charts/sn-platform/templates/broker/_broker.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion charts/sn-platform/templates/prometheus/_prometheus.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions charts/sn-platform/templates/proxy/_proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

Expand All @@ -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/",
Expand All @@ -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%%"
},
Expand All @@ -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/",
Expand All @@ -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%%"
},
Expand Down
4 changes: 2 additions & 2 deletions charts/sn-platform/templates/vault/_vault.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion charts/sn-platform/templates/zookeeper/_zookeeper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions charts/sn-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
##
Expand Down Expand Up @@ -1871,15 +1871,15 @@ 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
metrics: [
"\".*\""
]
bookkeeper:
enabled: false
enabled: true
metrics: [
"\".*\""
]
Expand All @@ -1899,7 +1899,7 @@ datadog:
"\".*\""
]
vault:
enabled: false
enabled: true
auth:
enabled: false
token: ""
Expand Down

0 comments on commit 1cf5e06

Please sign in to comment.