This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch release-3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/release-3.0 by this push:
new 316fa9b86 fix: metric config enable can't be set to false (#2336)
316fa9b86 is described below
commit 316fa9b865183ed129a633ff6c7c8f13eeaa68de
Author: Wang Guan <[email protected]>
AuthorDate: Sat Jun 10 00:51:35 2023 +0800
fix: metric config enable can't be set to false (#2336)
---
config/metric_config.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/metric_config.go b/config/metric_config.go
index 14d7b7271..290993f28 100644
--- a/config/metric_config.go
+++ b/config/metric_config.go
@@ -34,7 +34,7 @@ import (
type MetricConfig struct {
Mode string `default:"pull" yaml:"mode"
json:"mode,omitempty" property:"mode"` // push or pull,
Namespace string `default:"dubbo" yaml:"namespace"
json:"namespace,omitempty" property:"namespace"`
- Enable bool `default:"true" yaml:"enable"
json:"enable,omitempty" property:"enable"`
+ Enable *bool `default:"true" yaml:"enable"
json:"enable,omitempty" property:"enable"`
Port string `default:"9090" yaml:"port"
json:"port,omitempty" property:"port"`
Path string `default:"/metrics" yaml:"path"
json:"path,omitempty" property:"path"`
PushGatewayAddress string `default:"" yaml:"push-gateway-address"
json:"push-gateway-address,omitempty" property:"push-gateway-address"`
@@ -50,7 +50,7 @@ func (mc *MetricConfig) ToReporterConfig()
*metrics.ReporterConfig {
defaultMetricsReportConfig.Namespace = mc.Namespace
}
- defaultMetricsReportConfig.Enable = mc.Enable
+ defaultMetricsReportConfig.Enable = *mc.Enable
defaultMetricsReportConfig.Port = mc.Port
defaultMetricsReportConfig.Path = mc.Path
defaultMetricsReportConfig.PushGatewayAddress = mc.PushGatewayAddress