Add metrics
This commit is contained in:
@@ -21,6 +21,7 @@ type Config struct {
|
||||
HTTPListenAddr string `toml:"HTTPListenAddr"`
|
||||
HTTPAccessLogEnable bool `toml:"HTTPAccessLogEnable"`
|
||||
LogLevel string `toml:"LogLevel"`
|
||||
MetricsEnable bool `toml:"MetricsEnable"`
|
||||
}
|
||||
|
||||
type InvalidValueError struct {
|
||||
@@ -89,6 +90,13 @@ func (c *Config) UpdateFromEnv() error {
|
||||
}
|
||||
}
|
||||
|
||||
if metricsEnable, found := os.LookupEnv("DOGTAMER_METRICSENABLE"); found {
|
||||
switch strings.ToUpper(metricsEnable) {
|
||||
case "TRUE", "YES", "ENABLE":
|
||||
c.MetricsEnable = true
|
||||
}
|
||||
}
|
||||
|
||||
return c.Verify()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user