add metrics for service

This commit is contained in:
ginuerzh
2022-03-05 00:28:13 +08:00
parent 8d8785f534
commit e587b4df7c
34 changed files with 548 additions and 118 deletions

View File

@ -11,7 +11,7 @@ import (
"github.com/go-gost/gost/pkg/config"
"github.com/go-gost/gost/pkg/metadata"
"github.com/go-gost/gost/pkg/metrics"
metrics "github.com/go-gost/gost/pkg/metrics/service"
"github.com/go-gost/gost/pkg/registry"
)
@ -46,6 +46,12 @@ func buildConfigFromCmd(services, nodes stringList) (*config.Config, error) {
}
}
if v := os.Getenv("GOST_LOGGING_LEVEL"); v != "" {
cfg.Log = &config.LogConfig{
Level: v,
}
}
var chain *config.ChainConfig
if len(nodes) > 0 {
chain = &config.ChainConfig{

View File

@ -8,7 +8,7 @@ import (
"github.com/go-gost/gost/pkg/config"
"github.com/go-gost/gost/pkg/config/parsing"
"github.com/go-gost/gost/pkg/logger"
"github.com/go-gost/gost/pkg/metrics"
metrics "github.com/go-gost/gost/pkg/metrics/service"
"github.com/go-gost/gost/pkg/registry"
"github.com/go-gost/gost/pkg/service"
)

View File

@ -10,7 +10,7 @@ import (
"github.com/go-gost/gost/pkg/config"
"github.com/go-gost/gost/pkg/logger"
"github.com/go-gost/gost/pkg/metrics"
metrics "github.com/go-gost/gost/pkg/metrics/service"
)
var (