Files
cybertron/configs/prometheus.go

32 lines
796 B
Go
Raw Permalink Normal View History

2024-07-23 14:16:26 +05:30
package configs
type Prometheus struct {
appName string
host string
port int
flushInterval int
timeout int
enabled bool
buckets []float64
}
func GetPrometheusConfig() *Prometheus {
return &Prometheus{
appName: getString("prometheus.api.name", false),
host: getString("prometheus.host", true),
port: getInt("prometheus.port", true),
enabled: getBool("prometheus.enabled", false),
timeout: getInt("prometheus.timeout", false),
flushInterval: getInt("prometheus.flush.interval.in.ms", false),
buckets: getFloatSlice("prometheus.histogram.buckets", true),
}
}
func (p *Prometheus) GetAppName() string {
return p.appName
}
func (p *Prometheus) GetBuckets() []float64 {
return p.buckets
}