Skip to content

Commit

Permalink
Remove Loki initialisation from server.go. (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwilkie authored and bboreham committed Apr 17, 2018
1 parent 10239b9 commit 90f62a2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,13 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"

"github.com/weaveworks-experiments/loki/pkg/client"
"github.com/weaveworks/common/httpgrpc"
httpgrpc_server "github.com/weaveworks/common/httpgrpc/server"
"github.com/weaveworks/common/instrument"
"github.com/weaveworks/common/middleware"
"github.com/weaveworks/common/signals"
)

func init() {
tracer, err := loki.NewTracer()
if err != nil {
panic(fmt.Sprintf("Failed to create tracer: %v", err))
} else {
opentracing.InitGlobalTracer(tracer)
}
}

// Config for a Server
type Config struct {
MetricsNamespace string
Expand Down Expand Up @@ -67,8 +57,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {

// Server wraps a HTTP and gRPC server, and some common initialization.
//
// Servers will be automatically instrumented for Prometheus metrics
// and Loki tracing. HTTP over gRPC
// Servers will be automatically instrumented for Prometheus metrics.
type Server struct {
cfg Config
handler *signals.Handler
Expand Down Expand Up @@ -156,7 +145,6 @@ func New(cfg Config) (*Server, error) {
// RegisterInstrumentation on the given router.
func RegisterInstrumentation(router *mux.Router) {
router.Handle("/metrics", prometheus.Handler())
router.Handle("/traces", loki.Handler())
router.PathPrefix("/debug/pprof").Handler(http.DefaultServeMux)
}

Expand Down

0 comments on commit 90f62a2

Please sign in to comment.