diff --git a/pkg/client/httplib/filter/prometheus/filter.go b/pkg/client/httplib/filter/prometheus/filter.go index 917d4720..b4a418e0 100644 --- a/pkg/client/httplib/filter/prometheus/filter.go +++ b/pkg/client/httplib/filter/prometheus/filter.go @@ -23,11 +23,13 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/astaxie/beego/pkg/client/httplib" - "github.com/astaxie/beego/pkg/server/web" ) type FilterChainBuilder struct { summaryVec prometheus.ObserverVec + AppName string + ServerName string + RunMode string } func (builder *FilterChainBuilder) FilterChain(next httplib.Filter) httplib.Filter { @@ -36,9 +38,9 @@ func (builder *FilterChainBuilder) FilterChain(next httplib.Filter) httplib.Filt Name: "beego", Subsystem: "remote_http_request", ConstLabels: map[string]string{ - "server": web.BConfig.ServerName, - "env": web.BConfig.RunMode, - "appname": web.BConfig.AppName, + "server": builder.ServerName, + "env": builder.RunMode, + "appname": builder.AppName, }, Help: "The statics info for remote http requests", }, []string{"proto", "scheme", "method", "host", "path", "status", "duration", "isError"})