Skip to content

Commit

Permalink
add option setting: disable promethues metrics tls (#7490)
Browse files Browse the repository at this point in the history
close #7500
  • Loading branch information
bestwoody authored May 18, 2023
1 parent a1cbb63 commit f54a1d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbms/src/Server/MetricsPrometheus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::weak_ptr<prometheus::Collectable>> collectables{tiflash_metrics.registry};
if (context.getSharedContextDisagg()->isDisaggregatedComputeMode() && context.getSharedContextDisagg()->use_autoscaler)
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Server/MetricsPrometheus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit f54a1d4

Please sign in to comment.