mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
makes jaeger tracing configurable
This commit is contained in:
@@ -24,10 +24,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/search"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/social"
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
jaeger "github.com/uber/jaeger-client-go"
|
||||
jaegercfg "github.com/uber/jaeger-client-go/config"
|
||||
jaegerlog "github.com/uber/jaeger-client-go/log"
|
||||
"github.com/grafana/grafana/pkg/tracing"
|
||||
)
|
||||
|
||||
func NewGrafanaServer() models.GrafanaServer {
|
||||
@@ -65,33 +62,12 @@ func (g *GrafanaServerImpl) Start() {
|
||||
eventpublisher.Init()
|
||||
plugins.Init()
|
||||
|
||||
//localhost:5775
|
||||
|
||||
cfg := jaegercfg.Configuration{
|
||||
Disabled: false,
|
||||
Sampler: &jaegercfg.SamplerConfig{
|
||||
Type: jaeger.SamplerTypeConst,
|
||||
Param: 1,
|
||||
},
|
||||
Reporter: &jaegercfg.ReporterConfig{
|
||||
LogSpans: false,
|
||||
LocalAgentHostPort: "localhost:5775",
|
||||
},
|
||||
}
|
||||
|
||||
jLogger := jaegerlog.StdLogger
|
||||
|
||||
tracer, closer, err := cfg.New(
|
||||
"grafana",
|
||||
jaegercfg.Logger(jLogger),
|
||||
)
|
||||
closer, err := tracing.Init(setting.Cfg)
|
||||
if err != nil {
|
||||
g.log.Error("tracing", "error", err)
|
||||
g.log.Error("Tracing settings is not valid", "error", err)
|
||||
g.Shutdown(1, "Startup failed")
|
||||
return
|
||||
}
|
||||
|
||||
opentracing.InitGlobalTracer(tracer)
|
||||
defer closer.Close()
|
||||
|
||||
// init alerting
|
||||
@@ -104,7 +80,7 @@ func (g *GrafanaServerImpl) Start() {
|
||||
cleanUpService := cleanup.NewCleanUpService()
|
||||
g.childRoutines.Go(func() error { return cleanUpService.Run(g.context) })
|
||||
|
||||
if err := notifications.Init(); err != nil {
|
||||
if err = notifications.Init(); err != nil {
|
||||
g.log.Error("Notification service failed to initialize", "error", err)
|
||||
g.Shutdown(1, "Startup failed")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user