فهرست منبع

Disable metrics by default

Chris Spiegel 1 ماه پیش
والد
کامیت
1d9f06d4ac
3فایلهای تغییر یافته به همراه10 افزوده شده و 7 حذف شده
  1. 4 0
      RELEASE-NOTES.md
  2. 5 6
      service/OneService.cpp
  3. 1 1
      service/README.md

+ 4 - 0
RELEASE-NOTES.md

@@ -1,6 +1,10 @@
 ZeroTier Release Notes
 ======
 
+## WORK-IN-PROGRESS
+
+  * Metrics collection is now disabled by default. It can be enabled via the `enableMetrics` setting in `local.conf`.
+
 ## 2025-08-21 -- Version 1.16.0
 
   * License Changes

+ 5 - 6
service/OneService.cpp

@@ -988,7 +988,6 @@ class OneServiceImpl : public OneService {
 		_ports[1] = 0;
 		_ports[2] = 0;
 
-		prometheus::simpleapi::saver.set_registry(prometheus::simpleapi::registry_ptr);
 		prometheus::simpleapi::saver.set_delay(std::chrono::seconds(5));
 		prometheus::simpleapi::saver.set_out_file(_homePath + ZT_PATH_SEPARATOR + "metrics.prom");
 
@@ -2932,13 +2931,13 @@ class OneServiceImpl : public OneService {
 			}
 		}
 
-		bool disableMetrics = OSUtils::jsonBool(settings["disableMetrics"], false);
-		if (disableMetrics) {
-			std::shared_ptr<prometheus::Registry> registry;
-			prometheus::simpleapi::saver.set_registry(registry);
+		bool enableMetrics = OSUtils::jsonBool(settings["enableMetrics"], false);
+		if (enableMetrics) {
+			prometheus::simpleapi::saver.set_registry(prometheus::simpleapi::registry_ptr);
 		}
 		else {
-			prometheus::simpleapi::saver.set_registry(prometheus::simpleapi::registry_ptr);
+			std::shared_ptr<prometheus::Registry> registry;
+			prometheus::simpleapi::saver.set_registry(registry);
 		}
 	}
 

+ 1 - 1
service/README.md

@@ -42,7 +42,7 @@ Settings available in `local.conf` (this is not valid JSON, and JSON does not al
 		"bind": [ "ip",... ], /* If present and non-null, bind to these IPs instead of to each interface (wildcard IP allowed) */
 		"allowTcpFallbackRelay": true|false, /* Allow or disallow establishment of TCP relay connections (true by default) */
 		"multipathMode": 0|1|2, /* multipath mode: none (0), random (1), proportional (2) */
-		"disableMetrics": true|false /* If true, disable the collection of metrics in metrics.prom. */
+		"enableMetrics": true|false /* If true, enable the collection of metrics in metrics.prom. */
 	}
 }
 ```