Skip to content

Commit

Permalink
Merge pull request grafana#149 from grafana/upgrade-cortex
Browse files Browse the repository at this point in the history
Upgrade cortex to v1.3.0
  • Loading branch information
joe-elliott authored Sep 1, 2020
2 parents 96d2945 + da599a5 commit 5777da4
Show file tree
Hide file tree
Showing 2,210 changed files with 947,795 additions and 23,550 deletions.
22 changes: 11 additions & 11 deletions cmd/tempo/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/grafana/tempo/pkg/compactor"
"github.com/grafana/tempo/pkg/distributor"
"github.com/grafana/tempo/pkg/ingester"
"github.com/grafana/tempo/pkg/ingester/client"
ingester_client "github.com/grafana/tempo/pkg/ingester/client"
"github.com/grafana/tempo/pkg/querier"
"github.com/grafana/tempo/pkg/storage"
"github.com/grafana/tempo/pkg/util/validation"
Expand All @@ -29,15 +29,15 @@ type Config struct {
AuthEnabled bool `yaml:"auth_enabled,omitempty"`
HTTPPrefix string `yaml:"http_prefix"`

Server server.Config `yaml:"server,omitempty"`
Distributor distributor.Config `yaml:"distributor,omitempty"`
IngesterClient client.Config `yaml:"ingester_client,omitempty"`
Querier querier.Config `yaml:"querier,omitempty"`
Compactor compactor.Config `yaml:"compactor,omitempty"`
Ingester ingester.Config `yaml:"ingester,omitempty"`
StorageConfig storage.Config `yaml:"storage_config,omitempty"`
LimitsConfig validation.Limits `yaml:"limits_config,omitempty"`
MemberlistKV memberlist.KVConfig `yaml:"memberlist,omitempty"`
Server server.Config `yaml:"server,omitempty"`
Distributor distributor.Config `yaml:"distributor,omitempty"`
IngesterClient ingester_client.Config `yaml:"ingester_client,omitempty"`
Querier querier.Config `yaml:"querier,omitempty"`
Compactor compactor.Config `yaml:"compactor,omitempty"`
Ingester ingester.Config `yaml:"ingester,omitempty"`
StorageConfig storage.Config `yaml:"storage_config,omitempty"`
LimitsConfig validation.Limits `yaml:"limits_config,omitempty"`
MemberlistKV memberlist.KVConfig `yaml:"memberlist,omitempty"`
}

// RegisterFlags registers flag.
Expand Down Expand Up @@ -73,7 +73,7 @@ type App struct {
compactor *compactor.Compactor
ingester *ingester.Ingester
store storage.Store
memberlistKV *memberlist.KVInit
memberlistKV *memberlist.KVInitService

httpAuthMiddleware middleware.Interface
}
Expand Down
16 changes: 12 additions & 4 deletions cmd/tempo/app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"os"
"strings"
"time"

"github.com/cortexproject/cortex/pkg/ring"
"github.com/cortexproject/cortex/pkg/ring/kv/codec"
Expand Down Expand Up @@ -121,7 +122,7 @@ func (t *App) initServer() (err error) {

func (t *App) initRing() (err error) {
t.cfg.Ingester.LifecyclerConfig.RingConfig.KVStore.MemberlistKV = t.memberlistKV.GetMemberlistKV
t.ring, err = ring.New(t.cfg.Ingester.LifecyclerConfig.RingConfig, "ingester", ring.IngesterRingKey)
t.ring, err = ring.New(t.cfg.Ingester.LifecyclerConfig.RingConfig, "ingester", ring.IngesterRingKey, prometheus.DefaultRegisterer)
if err != nil {
return err
}
Expand Down Expand Up @@ -165,7 +166,7 @@ func (t *App) stopDistributor() (err error) {
}

func (t *App) initIngester() (err error) {
t.cfg.Ingester.LifecyclerConfig.ListenPort = &t.cfg.Server.GRPCListenPort
t.cfg.Ingester.LifecyclerConfig.ListenPort = t.cfg.Server.GRPCListenPort
t.cfg.Ingester.LifecyclerConfig.RingConfig.KVStore.MemberlistKV = t.memberlistKV.GetMemberlistKV
t.ingester, err = ingester.New(t.cfg.Ingester, t.cfg.IngesterClient, t.store, t.overrides)
if err != nil {
Expand Down Expand Up @@ -252,12 +253,19 @@ func (t *App) initMemberlistKV() error {
}
t.cfg.MemberlistKV.NodeName = hostname + "-" + uuid.New().String()

t.memberlistKV = memberlist.NewKVInit(&t.cfg.MemberlistKV)
t.memberlistKV = memberlist.NewKVInitService(&t.cfg.MemberlistKV)
return nil
}

func (t *App) stopMemberlistKV() error {
t.memberlistKV.Stop()
ctx, cancelFunc := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelFunc()

t.memberlistKV.StopAsync()
err := t.memberlistKV.AwaitTerminated(ctx)
if err != nil {
return fmt.Errorf("Failed to stop memberlist %w", err)
}
return nil
}

Expand Down
25 changes: 11 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.15

require (
cloud.google.com/go/storage v1.6.0
github.com/cortexproject/cortex v0.7.0
github.com/cortexproject/cortex v1.3.0
github.com/go-kit/kit v0.10.0
github.com/gogo/protobuf v1.3.1
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
Expand All @@ -19,7 +19,7 @@ require (
github.com/karrick/godirwalk v1.16.1
github.com/olekukonko/tablewriter v0.0.2
github.com/open-telemetry/opentelemetry-proto v0.4.0
github.com/opentracing/opentracing-go v1.1.1-0.20200124165624-2876d2018785
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/common v0.11.1
Expand All @@ -34,21 +34,18 @@ require (
go.uber.org/ratelimit v0.1.0
go.uber.org/zap v1.15.0
google.golang.org/api v0.29.0
google.golang.org/grpc v1.29.1
google.golang.org/grpc v1.30.0
gopkg.in/yaml.v2 v2.3.0
)

replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.2.0+incompatible

// Override reference that causes an error from Go proxy - see https://github.com/golang/go/issues/33558
replace k8s.io/client-go => k8s.io/client-go v0.0.0-20190620085101-78d2af792bab

// All 3 below replace directives exist due to
// All of the below replace directives exist due to
// Cortex -> ETCD -> GRPC requiring 1.29.1
// Otel Collector -> requiring 1.30.1
// Once this is merged: https://github.com/etcd-io/etcd/pull/12155 and Cortex revendors we should be able to update everything to current
replace google.golang.org/grpc => google.golang.org/grpc v1.29.1

replace go.etcd.io/etcd => go.etcd.io/etcd v0.5.0-alpha.5.0.20200520232829-54ba9589114f

replace github.com/sercand/kuberesolver => github.com/sercand/kuberesolver v2.4.0+incompatible
replace (
github.com/gocql/gocql => github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85
github.com/sercand/kuberesolver => github.com/sercand/kuberesolver v2.4.0+incompatible
go.etcd.io/etcd => go.etcd.io/etcd v0.5.0-alpha.5.0.20200520232829-54ba9589114f
google.golang.org/grpc => google.golang.org/grpc v1.29.1
k8s.io/client-go => k8s.io/client-go v0.18.3
)
Loading

0 comments on commit 5777da4

Please sign in to comment.