This is an automated email from the ASF dual-hosted git repository.

zhaoyunxing pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 08f7e4fe9 fix: some previous bugs
     new d8b2baafb Merge pull request #1812 from LaurenceLiZhixin/metrics-bugs
08f7e4fe9 is described below

commit 08f7e4fe9174a01e4ab56f80de0018512375a3a8
Author: LaurenceLiZhixin <[email protected]>
AuthorDate: Wed Apr 6 10:47:54 2022 +0800

    fix: some previous bugs
---
 config/config_loader_options.go | 2 +-
 config/metric_config.go         | 4 ++--
 config/reference_config.go      | 5 +++++
 imports/imports.go              | 2 ++
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/config/config_loader_options.go b/config/config_loader_options.go
index 120c22bd1..0f86300b7 100644
--- a/config/config_loader_options.go
+++ b/config/config_loader_options.go
@@ -47,7 +47,7 @@ type loaderConf struct {
 }
 
 func NewLoaderConf(opts ...LoaderConfOption) *loaderConf {
-       configFilePath := "./conf/dubbogo.yaml"
+       configFilePath := "../conf/dubbogo.yaml"
        if configFilePathFromEnv := os.Getenv(constant.ConfigFileEnvKey); 
configFilePathFromEnv != "" {
                configFilePath = configFilePathFromEnv
        }
diff --git a/config/metric_config.go b/config/metric_config.go
index 13ecf2dd0..291e4c7bc 100644
--- a/config/metric_config.go
+++ b/config/metric_config.go
@@ -32,7 +32,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             string `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"`
@@ -47,7 +47,7 @@ func (mc *MetricConfig) ToReporterConfig() 
*metrics.ReporterConfig {
                defaultMetricsReportConfig.Namespace = mc.Namespace
        }
 
-       defaultMetricsReportConfig.Enable = mc.Enable == "1"
+       defaultMetricsReportConfig.Enable = mc.Enable
        defaultMetricsReportConfig.Port = mc.Port
        defaultMetricsReportConfig.Path = mc.Path
        defaultMetricsReportConfig.PushGatewayAddress = mc.PushGatewayAddress
diff --git a/config/reference_config.go b/config/reference_config.go
index 5be820505..af8f48d8d 100644
--- a/config/reference_config.go
+++ b/config/reference_config.go
@@ -385,6 +385,11 @@ func (pcb *ReferenceConfigBuilder) SetProtocol(protocol 
string) *ReferenceConfig
        return pcb
 }
 
+func (pcb *ReferenceConfigBuilder) SetURL(url string) *ReferenceConfigBuilder {
+       pcb.referenceConfig.URL = url
+       return pcb
+}
+
 func (pcb *ReferenceConfigBuilder) Build() *ReferenceConfig {
        return pcb.referenceConfig
 }
diff --git a/imports/imports.go b/imports/imports.go
index 23f9d676f..8a3358523 100644
--- a/imports/imports.go
+++ b/imports/imports.go
@@ -51,6 +51,8 @@ import (
        _ "dubbo.apache.org/dubbo-go/v3/filter/sentinel"
        _ "dubbo.apache.org/dubbo-go/v3/filter/token"
        _ "dubbo.apache.org/dubbo-go/v3/filter/tps"
+       _ "dubbo.apache.org/dubbo-go/v3/filter/tps/limiter"
+       _ "dubbo.apache.org/dubbo-go/v3/filter/tps/strategy"
        _ "dubbo.apache.org/dubbo-go/v3/filter/tracing"
        _ "dubbo.apache.org/dubbo-go/v3/metadata/mapping/metadata"
        _ "dubbo.apache.org/dubbo-go/v3/metadata/report/etcd"

Reply via email to