feat: add default metrics address (#1595)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2022-08-26 10:36:38 +08:00
parent ad553d949b
commit 066fc3f3af
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
5 changed files with 14 additions and 1 deletions

View File

@ -308,6 +308,7 @@ func New() *Config {
},
Metrics: &MetricsConfig{
Enable: false,
Addr: DefaultMetricsAddr,
EnablePeerGauge: true,
},
}

View File

@ -36,7 +36,7 @@ const (
// DefaultGRPCPort is default port for grpc server.
DefaultGRPCPort = 65003
// DefaultRESTAddr is default port for rest server.
// DefaultRESTAddr is default address for rest server.
DefaultRESTAddr = ":8080"
)
@ -83,3 +83,8 @@ const (
// DefaultPostgresTimezone is default timezone for postgres.
DefaultPostgresTimezone = "UTC"
)
const (
// DefaultMetricsAddr is default address for metrics server.
DefaultMetricsAddr = ":8000"
)

View File

@ -119,6 +119,7 @@ func New() *Config {
},
Metrics: &MetricsConfig{
Enable: false,
Addr: DefaultMetricsAddr,
EnablePeerHost: false,
},
}

View File

@ -185,6 +185,7 @@ func TestConfig_New(t *testing.T) {
},
Metrics: &MetricsConfig{
Enable: false,
Addr: ":8000",
EnablePeerHost: false,
},
})

View File

@ -119,3 +119,8 @@ const (
// DefaultJobRedisBackendDB is default db for redis backend.
DefaultJobRedisBackendDB = 2
)
const (
// DefaultMetricsAddr is default address for metrics server.
DefaultMetricsAddr = ":8000"
)