From 5052945f7e29e11df7fcb6cd6d3898e71e9bef91 Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Tue, 12 Sep 2023 04:38:28 +1000 Subject: [PATCH] fix: use 9090 as prometheus port across services for consistency (#330) Signed-off-by: Lenin Mehedy --- charts/hedera-network/config-files/haproxy.cfg | 4 ++-- charts/hedera-network/config-files/otel-collector-config.yaml | 2 +- charts/hedera-network/templates/services/haproxy-svc.yaml | 4 ++-- .../hedera-network/templates/services/network-node-svc.yaml | 4 ++-- charts/hedera-network/templates/sidecars/_otel-collector.tpl | 4 ++-- charts/hedera-network/values.yaml | 2 +- dev/Makefile | 3 +-- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/charts/hedera-network/config-files/haproxy.cfg b/charts/hedera-network/config-files/haproxy.cfg index 7ef03025c..428d98eb2 100644 --- a/charts/hedera-network/config-files/haproxy.cfg +++ b/charts/hedera-network/config-files/haproxy.cfg @@ -3,7 +3,7 @@ global maxconn 100000 ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS ssl-default-bind-options ssl-min-ver TLSv1.1 - stats socket 0.0.0.0:14566 + stats socket 0.0.0.0:9090 defaults log global maxconn 100000 @@ -48,7 +48,7 @@ backend be_servers_tls server server1 network-{{ .nodeConfig.name }}-svc:50212 check inter 10s downinter 10s observe layer4 error-limit 5 on-error mark-down listen stats mode http - bind 0.0.0.0:14567 + bind 0.0.0.0:9090 http-request use-service prometheus-exporter if { path /metrics } stats enable stats uri /stats diff --git a/charts/hedera-network/config-files/otel-collector-config.yaml b/charts/hedera-network/config-files/otel-collector-config.yaml index 962a9ff00..f2f31b33a 100644 --- a/charts/hedera-network/config-files/otel-collector-config.yaml +++ b/charts/hedera-network/config-files/otel-collector-config.yaml @@ -18,7 +18,7 @@ processors: exporters: prometheus: - endpoint: "0.0.0.0:8889" # note: network-node-svc exposes this port for all prometheus metrics instead of node's port 9999 + endpoint: "0.0.0.0:9090" # note: network-node-svc exposes this port for all prometheus metrics instead of node's port 9999 const_labels: source: p-{{ default "otel-collector" .otelDefaults.nameOverride }} # PromQL: {source="p-otel-collector"} diff --git a/charts/hedera-network/templates/services/haproxy-svc.yaml b/charts/hedera-network/templates/services/haproxy-svc.yaml index 3fe5f1005..16e04abd5 100644 --- a/charts/hedera-network/templates/services/haproxy-svc.yaml +++ b/charts/hedera-network/templates/services/haproxy-svc.yaml @@ -25,8 +25,8 @@ spec: port: 50212 targetPort: 50212 - name: prometheus # port name must be prometheus for prometheus-svc-monitor - port: 14567 # stats port - targetPort: 14567 + port: 9090 + targetPort: 9090 # stats port {{- end }} {{- end }} diff --git a/charts/hedera-network/templates/services/network-node-svc.yaml b/charts/hedera-network/templates/services/network-node-svc.yaml index 9c3359d41..8b425ae0b 100644 --- a/charts/hedera-network/templates/services/network-node-svc.yaml +++ b/charts/hedera-network/templates/services/network-node-svc.yaml @@ -31,6 +31,6 @@ spec: # Rather than exposing the node's metrics port 9999 directly, we expose otel-collect's prometheus port here. - name: prometheus # port name must be prometheus for prometheus-svc-monitor protocol: TCP - port: 8889 # otel-collector's prometheus exporter port - targetPort: 8889 + port: 9090 + targetPort: 9090 # otel-collector's prometheus exporter port {{- end }} diff --git a/charts/hedera-network/templates/sidecars/_otel-collector.tpl b/charts/hedera-network/templates/sidecars/_otel-collector.tpl index 9944a2ac0..44e0fd376 100644 --- a/charts/hedera-network/templates/sidecars/_otel-collector.tpl +++ b/charts/hedera-network/templates/sidecars/_otel-collector.tpl @@ -11,8 +11,8 @@ - name: otlp # otel port defined in otel-collector config containerPort: 4317 protocol: TCP - - name: prometheus # prometheus exporter port as specified in otel-collector-config.yaml - containerPort: 8889 + - name: prometheus + containerPort: 9090 protocol: TCP - name: health # for otel-collector liveness check containerPort: 13133 diff --git a/charts/hedera-network/values.yaml b/charts/hedera-network/values.yaml index e7835e112..242d2d9fa 100644 --- a/charts/hedera-network/values.yaml +++ b/charts/hedera-network/values.yaml @@ -164,7 +164,7 @@ defaults: resources: {} receivers: prometheus: - scrapeTargets: [ 0.0.0.0:9999 ] # hedera node metrics are exposed at port 9090 + scrapeTargets: [ 0.0.0.0:9999 ] # hedera node metrics are exposed at port 9999 scrapeInterval: 5s exporters: otlp: diff --git a/dev/Makefile b/dev/Makefile index 45a92d8c7..42645deee 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -181,8 +181,7 @@ deploy-prometheus: deploy-prometheus-operator .PHONY: destroy-prometheus destroy-prometheus: - -source "${SCRIPTS_DIR}/${TELEMETRY_SCRIPT}" && unexpose_prometheus && destroy-prometheus - -${MAKE} destroy-prometheus-operator + source "${SCRIPTS_DIR}/${TELEMETRY_SCRIPT}" && unexpose_prometheus && destroy-prometheus .PHONY: deploy-telemetry-stack deploy-telemetry-stack: deploy-prometheus deploy-grafana-tempo