Commit 6b1ae1a8 by bergquist Committed by Carl Bergquist

use internal init for settings

parent dd9d4ecf
......@@ -54,8 +54,7 @@ func (g *GrafanaServerImpl) Start() {
g.writePIDFile()
initSql()
metricsCfg := metrics.ReadSettings(setting.Cfg)
metrics.Init(metricsCfg)
metrics.Init(setting.Cfg)
search.Init()
login.Init()
social.NewOAuthService()
......
......@@ -360,12 +360,6 @@ func (b *Bridge) replaceCounterWithDelta(mf *dto.MetricFamily, metric model.Metr
}
return float64(value)
//println("use delta for", metric[model.MetricNameLabel], mf.GetType().String())
//TODO(bergquist): turn _count in summery into delta
//TODO(bergquist): turn _count in histogram into delta
}
func (b *Bridge) returnDelta(metric model.Metric, value model.SampleValue) float64 {
......
......@@ -3,12 +3,13 @@ package metrics
import (
"context"
ini "gopkg.in/ini.v1"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/metrics/graphitebridge"
)
var metricsLogger log.Logger = log.New("metrics")
var metricPublishCounter int64 = 0
type logWrapper struct {
logger log.Logger
......@@ -18,7 +19,12 @@ func (lw *logWrapper) Println(v ...interface{}) {
lw.logger.Info("graphite metric bridge", v...)
}
func Init(settings *MetricSettings) {
func Init(file *ini.File) {
cfg := ReadSettings(file)
internalInit(cfg)
}
func internalInit(settings *MetricSettings) {
initMetricVars(settings)
if settings.GraphiteBridgeConfig != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment