From f54a1d476e93c0b9d0265f7bdd2140a47fde52ef Mon Sep 17 00:00:00 2001 From: bestwoody <89765764+bestwoody@users.noreply.github.com> Date: Thu, 18 May 2023 16:27:36 +0800 Subject: [PATCH] add option setting: disable promethues metrics tls (#7490) close pingcap/tiflash#7500 --- dbms/src/Server/MetricsPrometheus.cpp | 2 +- dbms/src/Server/MetricsPrometheus.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Server/MetricsPrometheus.cpp b/dbms/src/Server/MetricsPrometheus.cpp index 07c165afed7..24084dbb858 100644 --- a/dbms/src/Server/MetricsPrometheus.cpp +++ b/dbms/src/Server/MetricsPrometheus.cpp @@ -267,7 +267,7 @@ MetricsPrometheus::MetricsPrometheus( addr = "[" + listen_host + "]:" + metrics_port; else addr = listen_host + ":" + metrics_port; - if (context.getSecurityConfig()->hasTlsConfig()) + if (context.getSecurityConfig()->hasTlsConfig() && !conf.getBool(status_disable_metrics_tls, false)) { std::vector> collectables{tiflash_metrics.registry}; if (context.getSharedContextDisagg()->isDisaggregatedComputeMode() && context.getSharedContextDisagg()->use_autoscaler) diff --git a/dbms/src/Server/MetricsPrometheus.h b/dbms/src/Server/MetricsPrometheus.h index e5f31825e2d..03c1baca5f3 100644 --- a/dbms/src/Server/MetricsPrometheus.h +++ b/dbms/src/Server/MetricsPrometheus.h @@ -43,6 +43,7 @@ class MetricsPrometheus static constexpr auto status_metrics_interval = "status.metrics_interval"; static constexpr auto status_metrics_addr = "status.metrics_addr"; static constexpr auto status_metrics_port = "status.metrics_port"; + static constexpr auto status_disable_metrics_tls = "status.disable_metrics_tls"; void run();