Skip to content

Commit

Permalink
Re-add gRPC recovery middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanRushing committed Sep 27, 2021
1 parent d1d202c commit 3103a19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/weaveworks/common/middleware"
"github.com/weaveworks/common/server"
"github.com/weaveworks/common/signals"
"google.golang.org/grpc"
"google.golang.org/grpc/health/grpc_health_v1"

"github.com/grafana/loki/pkg/distributor"
Expand All @@ -43,6 +44,7 @@ import (
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/stores/shipper/compactor"
"github.com/grafana/loki/pkg/tracing"
serverutil "github.com/grafana/loki/pkg/util/server"
"github.com/grafana/loki/pkg/validation"
)

Expand Down Expand Up @@ -220,6 +222,8 @@ func New(cfg Config) (*Loki, error) {
}

func (t *Loki) setupAuthMiddleware() {
t.Cfg.Server.GRPCMiddleware = []grpc.UnaryServerInterceptor{serverutil.RecoveryGRPCUnaryInterceptor}
t.Cfg.Server.GRPCStreamMiddleware = []grpc.StreamServerInterceptor{serverutil.RecoveryGRPCStreamInterceptor}
// Don't check auth header on TransferChunks, as we weren't originally
// sending it and this could cause transfers to fail on update.
t.HTTPAuthMiddleware = fakeauth.SetupAuthMiddleware(&t.Cfg.Server, t.Cfg.AuthEnabled,
Expand Down

0 comments on commit 3103a19

Please sign in to comment.