mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 03:11:01 -06:00
use internal init for settings
This commit is contained in:
parent
dd9d4ecfbe
commit
6b1ae1a8a8
@ -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 {
|
Loading…
Reference in New Issue
Block a user