feat: provide metrics endpoint (#3902)

* feat: provide metrics endpoint

* config

* enable otel metrics by default

Co-authored-by: Florian Forster <florian@caos.ch>
This commit is contained in:
Livio Spring
2022-07-18 10:42:32 +02:00
committed by GitHub
parent 7ef9dcbf50
commit 9b6dad18cb
9 changed files with 72 additions and 59 deletions

View File

@@ -8,6 +8,12 @@ type Config struct {
MeterName string
}
func NewTracerFromConfig(rawConfig map[string]interface{}) (err error) {
c := new(Config)
c.MeterName, _ = rawConfig["metername"].(string)
return c.NewMetrics()
}
func (c *Config) NewMetrics() (err error) {
metrics.M, err = NewMetrics(c.MeterName)
return err