Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove Loki initialisation from server.go. #79

Merged
merged 1 commit into from
Apr 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,12 @@ 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/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 @@ -64,8 +54,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 @@ -150,7 +139,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