From 5344a0bc6a75bfb03569a22512b4cf1628693b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveirinha?= Date: Wed, 14 Feb 2024 17:52:51 +0000 Subject: [PATCH] TUN-8242: Enable remote diagnostics by default This commit makes the remote diagnostics enabled by default, which is a useful feature when debugging cloudflared issues without manual intervention from users. Users can still opt-out by disabling the feature flag. --- cmd/cloudflared/tunnel/cmd.go | 2 +- component-tests/test_management.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/cloudflared/tunnel/cmd.go b/cmd/cloudflared/tunnel/cmd.go index 8c98032a..1fbae858 100644 --- a/cmd/cloudflared/tunnel/cmd.go +++ b/cmd/cloudflared/tunnel/cmd.go @@ -790,7 +790,7 @@ func tunnelFlags(shouldHide bool) []cli.Flag { Name: "management-diagnostics", Usage: "Enables the in-depth diagnostic routes to be made available over the management service (/debug/pprof, /metrics, etc.)", EnvVars: []string{"TUNNEL_MANAGEMENT_DIAGNOSTICS"}, - Value: false, + Value: true, }), selectProtocolFlag, overwriteDNSFlag, diff --git a/component-tests/test_management.py b/component-tests/test_management.py index 5ebbc5ed..cc6701fd 100644 --- a/component-tests/test_management.py +++ b/component-tests/test_management.py @@ -55,7 +55,7 @@ class TestManagement: config = component_tests_config(cfd_mode=CfdModes.NAMED, run_proxy_dns=False, provide_ingress=False) LOGGER.debug(config) config_path = write_config(tmp_path, config.full_config) - with start_cloudflared(tmp_path, config, cfd_pre_args=["tunnel", "--ha-connections", "1", "--management-diagnostics"], new_process=True): + with start_cloudflared(tmp_path, config, cfd_pre_args=["tunnel", "--ha-connections", "1"], new_process=True): wait_tunnel_ready(require_min_connections=1) cfd_cli = CloudflaredCli(config, config_path, LOGGER) url = cfd_cli.get_management_url("metrics", config, config_path) @@ -76,7 +76,7 @@ class TestManagement: config = component_tests_config(cfd_mode=CfdModes.NAMED, run_proxy_dns=False, provide_ingress=False) LOGGER.debug(config) config_path = write_config(tmp_path, config.full_config) - with start_cloudflared(tmp_path, config, cfd_pre_args=["tunnel", "--ha-connections", "1", "--management-diagnostics"], new_process=True): + with start_cloudflared(tmp_path, config, cfd_pre_args=["tunnel", "--ha-connections", "1"], new_process=True): wait_tunnel_ready(require_min_connections=1) cfd_cli = CloudflaredCli(config, config_path, LOGGER) url = cfd_cli.get_management_url("debug/pprof/heap", config, config_path) @@ -97,7 +97,7 @@ class TestManagement: config = component_tests_config(cfd_mode=CfdModes.NAMED, run_proxy_dns=False, provide_ingress=False) LOGGER.debug(config) config_path = write_config(tmp_path, config.full_config) - with start_cloudflared(tmp_path, config, cfd_pre_args=["tunnel", "--ha-connections", "1"], new_process=True): + with start_cloudflared(tmp_path, config, cfd_pre_args=["tunnel", "--ha-connections", "1", "--management-diagnostics=false"], new_process=True): wait_tunnel_ready(require_min_connections=1) cfd_cli = CloudflaredCli(config, config_path, LOGGER) url = cfd_cli.get_management_url("metrics", config, config_path)