Skip to content

Commit

Permalink
Add Jaeger initialisation for distributed tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Cobden committed Aug 8, 2018
1 parent 701bed6 commit be36c9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions prog/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/weaveworks/common/middleware"
"github.com/weaveworks/common/network"
"github.com/weaveworks/common/signals"
"github.com/weaveworks/common/tracing"
"github.com/weaveworks/go-checkpoint"
"github.com/weaveworks/scope/app"
"github.com/weaveworks/scope/app/multitenant"
Expand Down Expand Up @@ -202,6 +203,9 @@ func appMain(flags appFlags) {
setLogFormatter(flags.logPrefix)
runtime.SetBlockProfileRate(flags.blockProfileRate)

traceCloser := tracing.InitFromEnv()
defer traceCloser.Close()

defer log.Info("app exiting")
rand.Seed(time.Now().UnixNano())
app.UniqueID = strconv.FormatInt(rand.Int63(), 16)
Expand Down
4 changes: 4 additions & 0 deletions prog/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/weaveworks/common/network"
"github.com/weaveworks/common/sanitize"
"github.com/weaveworks/common/signals"
"github.com/weaveworks/common/tracing"
"github.com/weaveworks/go-checkpoint"
"github.com/weaveworks/scope/common/hostname"
"github.com/weaveworks/scope/common/weave"
Expand Down Expand Up @@ -93,6 +94,9 @@ func probeMain(flags probeFlags, targets []appclient.Target) {
setLogLevel(flags.logLevel)
setLogFormatter(flags.logPrefix)

traceCloser := tracing.InitFromEnv()
defer traceCloser.Close()

// Setup in memory metrics sink
inm := metrics.NewInmemSink(time.Minute, 2*time.Minute)
sig := metrics.DefaultInmemSignal(inm)
Expand Down

0 comments on commit be36c9b

Please sign in to comment.