initiate grpc health check always (#4181)

pull/4155/head
Owen Diehl 5 years ago committed by GitHub
parent 7ee89ed1d9
commit eb5643be26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      pkg/loki/loki.go
  2. 2
      pkg/loki/modules.go

@ -17,6 +17,7 @@ import (
"github.com/cortexproject/cortex/pkg/util/fakeauth"
"github.com/cortexproject/cortex/pkg/util/flagext"
"github.com/cortexproject/cortex/pkg/util/grpc/healthcheck"
"github.com/cortexproject/cortex/pkg/util/modules"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/signals"
@ -36,6 +37,7 @@ import (
"github.com/weaveworks/common/middleware"
"github.com/weaveworks/common/server"
"google.golang.org/grpc"
"google.golang.org/grpc/health/grpc_health_v1"
"github.com/grafana/loki/pkg/distributor"
"github.com/grafana/loki/pkg/ingester"
@ -283,6 +285,8 @@ func (t *Loki) Run() error {
// before starting servers, register /ready handler. It should reflect entire Loki.
t.Server.HTTP.Path("/ready").Handler(t.readyHandler(sm))
grpc_health_v1.RegisterHealthServer(t.Server.GRPC, healthcheck.New(sm))
// This adds a way to see the config and the changes compared to the defaults
t.Server.HTTP.Path("/config").HandlerFunc(configHandler(t.Cfg, newDefaultConfig()))

@ -34,7 +34,6 @@ import (
"github.com/weaveworks/common/middleware"
"github.com/weaveworks/common/server"
"github.com/weaveworks/common/user"
"google.golang.org/grpc/health/grpc_health_v1"
"github.com/grafana/loki/pkg/distributor"
"github.com/grafana/loki/pkg/ingester"
@ -252,7 +251,6 @@ func (t *Loki) initIngester() (_ services.Service, err error) {
logproto.RegisterPusherServer(t.Server.GRPC, t.Ingester)
logproto.RegisterQuerierServer(t.Server.GRPC, t.Ingester)
logproto.RegisterIngesterServer(t.Server.GRPC, t.Ingester)
grpc_health_v1.RegisterHealthServer(t.Server.GRPC, t.Ingester)
t.Server.HTTP.Path("/flush").Handler(http.HandlerFunc(t.Ingester.FlushHandler))
t.Server.HTTP.Methods("POST").Path("/ingester/flush_shutdown").Handler(http.HandlerFunc(t.Ingester.ShutdownHandler))
return t.Ingester, nil

Loading…
Cancel
Save