|
|
|
@ -7,36 +7,28 @@ import ( |
|
|
|
|
"fmt" |
|
|
|
|
"net/http" |
|
|
|
|
|
|
|
|
|
"github.com/cortexproject/cortex/pkg/querier/worker" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/ruler/rulestore" |
|
|
|
|
"github.com/felixge/fgprof" |
|
|
|
|
|
|
|
|
|
"github.com/grafana/loki/pkg/runtime" |
|
|
|
|
"github.com/grafana/loki/pkg/storage/stores/shipper/compactor" |
|
|
|
|
"github.com/grafana/loki/pkg/validation" |
|
|
|
|
|
|
|
|
|
"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" |
|
|
|
|
|
|
|
|
|
cortex_tripper "github.com/cortexproject/cortex/pkg/querier/queryrange" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/querier/worker" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/ring" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/ring/kv/memberlist" |
|
|
|
|
cortex_ruler "github.com/cortexproject/cortex/pkg/ruler" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/ruler/rulestore" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/scheduler" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/util" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/util/fakeauth" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/util/flagext" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/util/grpc/healthcheck" |
|
|
|
|
util_log "github.com/cortexproject/cortex/pkg/util/log" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/util/modules" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/util/runtimeconfig" |
|
|
|
|
"github.com/cortexproject/cortex/pkg/util/services" |
|
|
|
|
|
|
|
|
|
"github.com/felixge/fgprof" |
|
|
|
|
"github.com/go-kit/kit/log/level" |
|
|
|
|
"github.com/pkg/errors" |
|
|
|
|
"github.com/prometheus/client_golang/prometheus" |
|
|
|
|
"github.com/weaveworks/common/middleware" |
|
|
|
|
"github.com/weaveworks/common/server" |
|
|
|
|
"google.golang.org/grpc" |
|
|
|
|
"github.com/weaveworks/common/signals" |
|
|
|
|
"google.golang.org/grpc/health/grpc_health_v1" |
|
|
|
|
|
|
|
|
|
"github.com/grafana/loki/pkg/distributor" |
|
|
|
@ -46,9 +38,12 @@ import ( |
|
|
|
|
"github.com/grafana/loki/pkg/querier" |
|
|
|
|
"github.com/grafana/loki/pkg/querier/queryrange" |
|
|
|
|
"github.com/grafana/loki/pkg/ruler" |
|
|
|
|
"github.com/grafana/loki/pkg/runtime" |
|
|
|
|
"github.com/grafana/loki/pkg/storage" |
|
|
|
|
"github.com/grafana/loki/pkg/storage/chunk" |
|
|
|
|
"github.com/grafana/loki/pkg/storage/stores/shipper/compactor" |
|
|
|
|
"github.com/grafana/loki/pkg/tracing" |
|
|
|
|
"github.com/grafana/loki/pkg/validation" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// Config is the root config for Loki.
|
|
|
|
@ -240,20 +235,6 @@ func (t *Loki) setupAuthMiddleware() { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var GRPCStreamAuthInterceptor = func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { |
|
|
|
|
switch info.FullMethod { |
|
|
|
|
// Don't check auth header on TransferChunks, as we weren't originally
|
|
|
|
|
// sending it and this could cause transfers to fail on update.
|
|
|
|
|
//
|
|
|
|
|
// Also don't check auth /frontend.Frontend/Process, as this handles
|
|
|
|
|
// queries for multiple users.
|
|
|
|
|
case "/logproto.Ingester/TransferChunks", "/frontend.Frontend/Process": |
|
|
|
|
return handler(srv, ss) |
|
|
|
|
default: |
|
|
|
|
return middleware.StreamServerUserHeaderInterceptor(srv, ss, info, handler) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func newDefaultConfig() *Config { |
|
|
|
|
defaultConfig := &Config{} |
|
|
|
|
defaultFS := flag.NewFlagSet("", flag.PanicOnError) |
|
|
|
|