Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgrade cortex to 1.6 and other dependencies. #442

Merged
merged 8 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GORELEASER := $(GOPATH)/bin/goreleaser

# More exclusions can be added similar with: -not -path './testbed/*'
ALL_SRC := $(shell find . -name '*.go' \
-not -path './vendor/*' \
-not -path './vendor*/*' \
-not -path './integration/*' \
-type f | sort)

Expand Down
2 changes: 1 addition & 1 deletion cmd/tempo/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"net/http"

cortex_frontend "github.com/cortexproject/cortex/pkg/querier/frontend"
cortex_frontend "github.com/cortexproject/cortex/pkg/frontend/v1"
"github.com/cortexproject/cortex/pkg/ring"
"github.com/cortexproject/cortex/pkg/ring/kv/memberlist"
"github.com/cortexproject/cortex/pkg/util"
Expand Down
27 changes: 16 additions & 11 deletions cmd/tempo/app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
"os"

"github.com/cortexproject/cortex/pkg/cortex"
cortex_frontend "github.com/cortexproject/cortex/pkg/querier/frontend"
cortex_frontend "github.com/cortexproject/cortex/pkg/frontend"
cortex_transport "github.com/cortexproject/cortex/pkg/frontend/transport"
cortex_frontend_v1pb "github.com/cortexproject/cortex/pkg/frontend/v1/frontendv1pb"
"github.com/cortexproject/cortex/pkg/ring"
"github.com/cortexproject/cortex/pkg/ring/kv/codec"
"github.com/cortexproject/cortex/pkg/ring/kv/memberlist"
Expand Down Expand Up @@ -129,13 +131,13 @@ func (t *App) initIngester() (services.Service, error) {
func (t *App) initQuerier() (services.Service, error) {
// validate worker config
// if we're not in single binary mode and worker address is not specified - bail
if t.cfg.Target != All && t.cfg.Querier.Worker.Address == "" {
if t.cfg.Target != All && t.cfg.Querier.Worker.FrontendAddress == "" {
return nil, fmt.Errorf("frontend worker address not specified")
} else if t.cfg.Target == All {
// if we're in single binary mode with no worker address specified, register default endpoint
if t.cfg.Querier.Worker.Address == "" {
t.cfg.Querier.Worker.Address = fmt.Sprintf("127.0.0.1:%d", t.cfg.Server.GRPCListenPort)
level.Warn(util.Logger).Log("msg", "Worker address is empty in single binary mode. Attempting automatic worker configuration. If queries are unresponsive consider configuring the worker explicitly.", "address", t.cfg.Querier.Worker.Address)
if t.cfg.Querier.Worker.FrontendAddress == "" {
t.cfg.Querier.Worker.FrontendAddress = fmt.Sprintf("127.0.0.1:%d", t.cfg.Server.GRPCListenPort)
level.Warn(util.Logger).Log("msg", "Worker address is empty in single binary mode. Attempting automatic worker configuration. If queries are unresponsive consider configuring the worker explicitly.", "address", t.cfg.Querier.Worker.FrontendAddress)
}
}

Expand All @@ -156,24 +158,27 @@ func (t *App) initQuerier() (services.Service, error) {

func (t *App) initQueryFrontend() (services.Service, error) {
var err error
t.frontend, err = cortex_frontend.New(t.cfg.Frontend.Config, util.Logger, prometheus.DefaultRegisterer)

cortexTripper, v1, _, err := cortex_frontend.InitFrontend(t.cfg.Frontend.Config, frontend.CortexNoQuerierLimits{}, 0, util.Logger, prometheus.DefaultRegisterer)
if err != nil {
return nil, err
}
t.frontend = v1

// custom tripperware that splits requests
tripperware, err := frontend.NewTripperware(t.cfg.Frontend, util.Logger, prometheus.DefaultRegisterer)
shardingTripperWare, err := frontend.NewTripperware(t.cfg.Frontend, util.Logger, prometheus.DefaultRegisterer)
if err != nil {
return nil, err
}
// tripperware will be called before f.roundTripper (which calls roundtripgrpc)
t.frontend.Wrap(tripperware)
shardingTripper := shardingTripperWare(cortexTripper)

cortexHandler := cortex_transport.NewHandler(t.cfg.Frontend.Config.Handler, shardingTripper, util.Logger, prometheus.DefaultRegisterer)

tracesHandler := middleware.Merge(
t.httpAuthMiddleware,
).Wrap(t.frontend.Handler())
).Wrap(cortexHandler)

cortex_frontend.RegisterFrontendServer(t.server.GRPC, t.frontend)
cortex_frontend_v1pb.RegisterFrontendServer(t.server.GRPC, t.frontend)
t.server.HTTP.Handle("/api/traces/{traceID}", tracesHandler)

return services.NewIdleService(nil, func(_ error) error {
Expand Down
27 changes: 19 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/alecthomas/kong v0.2.11
github.com/alicebob/miniredis v2.5.0+incompatible
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
github.com/cortexproject/cortex v1.4.0
github.com/cortexproject/cortex v1.6.0
github.com/go-kit/kit v0.10.0
github.com/gogo/protobuf v1.3.1
github.com/gogo/status v1.0.3
Expand All @@ -18,7 +18,6 @@ require (
github.com/google/uuid v1.1.1
github.com/gorilla/mux v1.7.4
github.com/grafana/loki v1.3.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
github.com/hashicorp/go-hclog v0.14.0
github.com/jaegertracing/jaeger v1.18.2-0.20200707061226-97d2319ff2be
Expand All @@ -29,25 +28,26 @@ require (
github.com/open-telemetry/opentelemetry-proto v0.4.0
github.com/opentracing/opentracing-go v1.2.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_golang v1.8.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.11.1
github.com/prometheus/prometheus v1.8.2-0.20200819132913-cb830b0a9c78
github.com/prometheus/common v0.15.0
github.com/prometheus/prometheus v1.8.2-0.20201119181812-c8f810083d3f
github.com/prometheus/prometheus/discovery/config v0.0.0-00010101000000-000000000000 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.6.1
github.com/uber-go/atomic v1.4.0
github.com/uber/jaeger-client-go v2.25.0+incompatible
github.com/weaveworks/common v0.0.0-20201029142910-313edde7a455
github.com/weaveworks/common v0.0.0-20201119133501-0619918236ec
github.com/willf/bitset v1.1.10 // indirect
github.com/willf/bloom v2.0.3+incompatible
go.opencensus.io v0.22.4
go.opentelemetry.io/collector v0.6.1
go.uber.org/atomic v1.6.0
go.uber.org/atomic v1.7.0
go.uber.org/goleak v1.1.10
go.uber.org/zap v1.15.0
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
google.golang.org/api v0.32.0
google.golang.org/api v0.35.0
google.golang.org/genproto v0.0.0-20201028140639-c77dae4b0522 // indirect
google.golang.org/grpc v1.33.1
gopkg.in/yaml.v2 v2.3.0
Expand All @@ -71,3 +71,14 @@ replace (
github.com/satori/go.uuid => github.com/satori/go.uuid v1.2.0
k8s.io/client-go => k8s.io/client-go v0.19.2
)

// opentelemtry collector requires older prometheus discovery config
// copied locally because having issues referencing a subpackage any other way
replace github.com/prometheus/prometheus/discovery/config => ./vendor-fix/github.com/prometheus/prometheus/discovery/config

// Pin github.com/go-openapi versions to match Prometheus alertmanager to avoid
// breaking changing affecting the alertmanager.
replace (
github.com/go-openapi/errors => github.com/go-openapi/errors v0.19.4
github.com/go-openapi/validate => github.com/go-openapi/validate v0.19.8
)
Loading