Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avereha/trace version #373

Merged
merged 4 commits into from Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions carbon/app.go
Expand Up @@ -316,7 +316,7 @@ func (app *App) startPersister() {
}

// Start starts
func (app *App) Start() (err error) {
func (app *App) Start(version string) (err error) {
app.Lock()
defer app.Unlock()

Expand Down Expand Up @@ -475,7 +475,7 @@ func (app *App) Start() (err error) {
carbonserver.InitPrometheus(app.PromRegisterer)
}
if conf.Tracing.Enabled {
app.FlushTraces = carbonserver.InitTracing(conf.Tracing.JaegerEndpoint, conf.Tracing.Stdout, conf.Tracing.SendTimeout.Value())
app.FlushTraces = carbonserver.InitTracing(conf.Tracing.JaegerEndpoint, conf.Tracing.Stdout, version, conf.Tracing.SendTimeout.Value())
}

if err = carbonserver.Listen(conf.Carbonserver.Listen); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions carbon/app_stop_test.go
Expand Up @@ -23,7 +23,7 @@ func TestStartStop(t *testing.T) {
app := New(configFile)

assert.NoError(app.ParseConfig())
assert.NoError(app.Start())
assert.NoError(app.Start("test-version"))

app.Stop()
})
Expand Down Expand Up @@ -51,7 +51,7 @@ func TestReloadAndCollectorDeadlock(t *testing.T) {
assert.NoError(t, app.ParseConfig())

app.Config.Common.MetricInterval = &Duration{time.Microsecond}
assert.NoError(t, app.Start())
assert.NoError(t, app.Start("test-version"))

reloadChan := make(chan struct{}, 1)
N := 1024
Expand Down
3 changes: 2 additions & 1 deletion carbonserver/trace.go
Expand Up @@ -35,7 +35,7 @@ type headerName struct {
}

// initTracer creates a new trace provider instance and registers it as global trace provider.
func (c *CarbonserverListener) InitTracing(jaegerEndpoint string, sendtoStdout bool, timeout time.Duration) func() {
func (c *CarbonserverListener) InitTracing(jaegerEndpoint string, sendtoStdout bool, version string, timeout time.Duration) func() {
logger := zapwriter.Logger("app")

propagator := trace.B3{}
Expand Down Expand Up @@ -64,6 +64,7 @@ func (c *CarbonserverListener) InitTracing(jaegerEndpoint string, sendtoStdout b
Tags: []kv.KeyValue{
kv.String("exporter", "jaeger"),
kv.String("host.hostname", fqdn),
kv.String("service.version", version),
},
}),
jaeger.RegisterAsGlobal(),
Expand Down
3 changes: 1 addition & 2 deletions go-carbon.go
Expand Up @@ -181,8 +181,7 @@ func main() {
app.PromRegisterer.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
http.Handle(cfg.Prometheus.Endpoint, promhttp.HandlerFor(app.PromRegistry, promhttp.HandlerOpts{}))
}

if err = app.Start(); err != nil {
if err = app.Start(BuildVersion); err != nil {
mainLogger.Fatal(err.Error())
} else {
mainLogger.Info("started")
Expand Down