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

Update cortex to v1.7.0-rc.0+(latest commit) #512

Merged
merged 6 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all 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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* [ENHANCEMENT] Add S3 options region and forcepathstyle [#431](https://github.com/grafana/tempo/issues/431)
* [ENHANCEMENT] Add exhaustive search to combine traces from all blocks in the backend. [#489](https://github.com/grafana/tempo/pull/489)
* [ENHANCEMENT] Add per-tenant block retention [#77](https://github.com/grafana/tempo/issues/77)
* [BUGFIX] Upgrade cortex dependency to 1.6 to address issue with forgetting ring membership [#442](https://github.com/grafana/tempo/pull/442)
* [BUGFIX] Upgrade cortex dependency to v1.7.0-rc.0+ to address issue with forgetting ring membership [#442](https://github.com/grafana/tempo/pull/442) [#512](https://github.com/grafana/tempo/pull/512)
* [BUGFIX] No longer raise the `tempodb_blocklist_poll_errors_total` metric if a block doesn't have meta or compacted meta. [#481](https://github.com/grafana/tempo/pull/481)

## v0.5.0
Expand Down
25 changes: 13 additions & 12 deletions cmd/tempo/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/cortexproject/cortex/pkg/util"
"github.com/cortexproject/cortex/pkg/util/flagext"
"github.com/cortexproject/cortex/pkg/util/grpc/healthcheck"
"github.com/cortexproject/cortex/pkg/util/log"
"github.com/cortexproject/cortex/pkg/util/modules"
"github.com/cortexproject/cortex/pkg/util/services"
"github.com/go-kit/kit/log/level"
Expand Down Expand Up @@ -92,26 +93,26 @@ func (c *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet) {
// CheckConfig checks if config values are suspect.
func (c *Config) CheckConfig() {
if c.Ingester.CompleteBlockTimeout < c.StorageConfig.Trace.BlocklistPoll {
level.Warn(util.Logger).Log("msg", "ingester.complete_block_timeout < storage.trace.blocklist_poll",
level.Warn(log.Logger).Log("msg", "ingester.complete_block_timeout < storage.trace.blocklist_poll",
"explan", "You may receive 404s between the time the ingesters have flushed a trace and the querier is aware of the new block")
}

if c.Compactor.Compactor.BlockRetention < c.StorageConfig.Trace.BlocklistPoll {
level.Warn(util.Logger).Log("msg", "compactor.compaction.compacted_block_timeout < storage.trace.blocklist_poll",
level.Warn(log.Logger).Log("msg", "compactor.compaction.compacted_block_timeout < storage.trace.blocklist_poll",
"explan", "Queriers and Compactors may attempt to read a block that no longer exists")
}

if c.Compactor.Compactor.RetentionConcurrency == 0 {
level.Warn(util.Logger).Log("msg", "c.Compactor.Compactor.RetentionConcurrency must be greater than zero. Using default.", "default", tempodb.DefaultRetentionConcurrency)
level.Warn(log.Logger).Log("msg", "c.Compactor.Compactor.RetentionConcurrency must be greater than zero. Using default.", "default", tempodb.DefaultRetentionConcurrency)
}

if c.StorageConfig.Trace.Backend == "s3" && c.Compactor.Compactor.FlushSizeBytes < 5242880 {
level.Warn(util.Logger).Log("msg", "c.Compactor.Compactor.FlushSizeBytes < 5242880",
level.Warn(log.Logger).Log("msg", "c.Compactor.Compactor.FlushSizeBytes < 5242880",
"explan", "Compaction flush size should be 5MB or higher for S3 backend")
}

if c.StorageConfig.Trace.BlocklistPollConcurrency == 0 {
level.Warn(util.Logger).Log("msg", "c.StorageConfig.Trace.BlocklistPollConcurrency must be greater than zero. Using default.", "default", tempodb.DefaultBlocklistPollConcurrency)
level.Warn(log.Logger).Log("msg", "c.StorageConfig.Trace.BlocklistPollConcurrency must be greater than zero. Using default.", "default", tempodb.DefaultBlocklistPollConcurrency)
}
}

Expand Down Expand Up @@ -193,7 +194,7 @@ func (t *App) setupAuthMiddleware() {
// Run starts, and blocks until a signal is received.
func (t *App) Run() error {
if !t.moduleManager.IsUserVisibleModule(t.cfg.Target) {
level.Warn(util.Logger).Log("msg", "selected target is an internal module, is this intended?", "target", t.cfg.Target)
level.Warn(log.Logger).Log("msg", "selected target is an internal module, is this intended?", "target", t.cfg.Target)
}

serviceMap, err := t.moduleManager.InitModuleServices(t.cfg.Target)
Expand All @@ -218,8 +219,8 @@ func (t *App) Run() error {
grpc_health_v1.RegisterHealthServer(t.server.GRPC, healthcheck.New(sm))

// Let's listen for events from this manager, and log them.
healthy := func() { level.Info(util.Logger).Log("msg", "Tempo started") }
stopped := func() { level.Info(util.Logger).Log("msg", "Tempo stopped") }
healthy := func() { level.Info(log.Logger).Log("msg", "Tempo started") }
stopped := func() { level.Info(log.Logger).Log("msg", "Tempo stopped") }
serviceFailed := func(service services.Service) {
// if any service fails, stop everything
sm.StopAsync()
Expand All @@ -228,15 +229,15 @@ func (t *App) Run() error {
for m, s := range serviceMap {
if s == service {
if service.FailureCase() == util.ErrStopProcess {
level.Info(util.Logger).Log("msg", "received stop signal via return error", "module", m, "err", service.FailureCase())
level.Info(log.Logger).Log("msg", "received stop signal via return error", "module", m, "err", service.FailureCase())
} else {
level.Error(util.Logger).Log("msg", "module failed", "module", m, "err", service.FailureCase())
level.Error(log.Logger).Log("msg", "module failed", "module", m, "err", service.FailureCase())
}
return
}
}

level.Error(util.Logger).Log("msg", "module failed", "module", "unknown", "err", service.FailureCase())
level.Error(log.Logger).Log("msg", "module failed", "module", "unknown", "err", service.FailureCase())
}
sm.AddListener(services.NewManagerListener(healthy, stopped, serviceFailed))

Expand Down Expand Up @@ -268,7 +269,7 @@ func (t *App) configHandler() http.HandlerFunc {
w.Header().Set("Content-Type", "text/yaml")
w.WriteHeader(http.StatusOK)
if _, err := w.Write(out); err != nil {
level.Error(util.Logger).Log("msg", "error writing response", "err", err)
level.Error(log.Logger).Log("msg", "error writing response", "err", err)
}
}

Expand Down
18 changes: 10 additions & 8 deletions cmd/tempo/app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/cortexproject/cortex/pkg/ring"
"github.com/cortexproject/cortex/pkg/ring/kv/codec"
"github.com/cortexproject/cortex/pkg/ring/kv/memberlist"
"github.com/cortexproject/cortex/pkg/util"
"github.com/cortexproject/cortex/pkg/util/log"
"github.com/cortexproject/cortex/pkg/util/modules"
"github.com/cortexproject/cortex/pkg/util/services"
"github.com/go-kit/kit/log/level"
Expand Down Expand Up @@ -137,7 +137,7 @@ func (t *App) initQuerier() (services.Service, error) {
// if we're in single binary mode with no worker address specified, register default endpoint
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)
level.Warn(log.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 @@ -159,20 +159,20 @@ func (t *App) initQuerier() (services.Service, error) {
func (t *App) initQueryFrontend() (services.Service, error) {
var err error

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

// custom tripperware that splits requests
shardingTripperWare, err := frontend.NewTripperware(t.cfg.Frontend, util.Logger, prometheus.DefaultRegisterer)
shardingTripperWare, err := frontend.NewTripperware(t.cfg.Frontend, log.Logger, prometheus.DefaultRegisterer)
if err != nil {
return nil, err
}
shardingTripper := shardingTripperWare(cortexTripper)

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

tracesHandler := middleware.Merge(
t.httpAuthMiddleware,
Expand Down Expand Up @@ -203,7 +203,7 @@ func (t *App) initCompactor() (services.Service, error) {
}

func (t *App) initStore() (services.Service, error) {
store, err := tempo_storage.NewStore(t.cfg.StorageConfig, util.Logger)
store, err := tempo_storage.NewStore(t.cfg.StorageConfig, log.Logger)
if err != nil {
return nil, fmt.Errorf("failed to create store %w", err)
}
Expand All @@ -226,12 +226,14 @@ func (t *App) initMemberlistKV() (services.Service, error) {
// todo: do we still need this? does the package do this by default now?
t.cfg.MemberlistKV.NodeName = hostname + "-" + uuid.New().String()

t.memberlistKV = memberlist.NewKVInitService(&t.cfg.MemberlistKV, util.Logger)
t.memberlistKV = memberlist.NewKVInitService(&t.cfg.MemberlistKV, log.Logger)

t.cfg.Ingester.LifecyclerConfig.RingConfig.KVStore.MemberlistKV = t.memberlistKV.GetMemberlistKV
t.cfg.Distributor.DistributorRing.KVStore.MemberlistKV = t.memberlistKV.GetMemberlistKV
t.cfg.Compactor.ShardingRing.KVStore.MemberlistKV = t.memberlistKV.GetMemberlistKV

t.server.HTTP.Handle("/memberlist", t.memberlistKV)

return t.memberlistKV, nil
}

Expand All @@ -254,7 +256,7 @@ func (t *App) setupModuleManager() error {
// Server: nil,
// Overrides: nil,
// Store: nil,
// MemberlistKV: nil,
MemberlistKV: {Server},
QueryFrontend: {Server},
Ring: {Server, MemberlistKV},
Distributor: {Ring, Server, Overrides},
Expand Down
18 changes: 9 additions & 9 deletions cmd/tempo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"github.com/weaveworks/common/logging"
"github.com/weaveworks/common/tracing"

"github.com/cortexproject/cortex/pkg/util"
"github.com/cortexproject/cortex/pkg/util/flagext"
"github.com/cortexproject/cortex/pkg/util/log"
)

const appName = "tempo"
Expand Down Expand Up @@ -55,20 +55,20 @@ func main() {

// Init the logger which will honor the log level set in config.Server
if reflect.DeepEqual(&config.Server.LogLevel, &logging.Level{}) {
level.Error(util.Logger).Log("msg", "invalid log level")
level.Error(log.Logger).Log("msg", "invalid log level")
os.Exit(1)
}
util.InitLogger(&config.Server)
log.InitLogger(&config.Server)

// Setting the environment variable JAEGER_AGENT_HOST enables tracing
trace, err := tracing.NewFromEnv(fmt.Sprintf("%s-%s", appName, config.Target))
if err != nil {
level.Error(util.Logger).Log("msg", "error initialising tracer", "err", err)
level.Error(log.Logger).Log("msg", "error initialising tracer", "err", err)
os.Exit(1)
}
defer func() {
if err := trace.Close(); err != nil {
level.Error(util.Logger).Log("msg", "error closing tracing", "err", err)
level.Error(log.Logger).Log("msg", "error closing tracing", "err", err)
os.Exit(1)
}
}()
Expand All @@ -82,19 +82,19 @@ func main() {
// Start Tempo
t, err := app.New(*config)
if err != nil {
level.Error(util.Logger).Log("msg", "error initialising Tempo", "err", err)
level.Error(log.Logger).Log("msg", "error initialising Tempo", "err", err)
os.Exit(1)
}

level.Info(util.Logger).Log("msg", "Starting Tempo", "version", version.Info())
level.Info(log.Logger).Log("msg", "Starting Tempo", "version", version.Info())

if err := t.Run(); err != nil {
level.Error(util.Logger).Log("msg", "error running Tempo", "err", err)
level.Error(log.Logger).Log("msg", "error running Tempo", "err", err)
os.Exit(1)
}
runtime.KeepAlive(ballast)

level.Info(util.Logger).Log("msg", "Tempo running")
level.Info(log.Logger).Log("msg", "Tempo running")
}

func loadConfig() (*app.Config, error) {
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ require (
contrib.go.opencensus.io/exporter/prometheus v0.2.0
github.com/Azure/azure-storage-blob-go v0.8.0
github.com/alecthomas/kong v0.2.11
github.com/cortexproject/cortex v1.6.0
github.com/cortexproject/cortex v1.6.1-0.20210205171041-527f9b58b93c
github.com/go-kit/kit v0.10.0
github.com/gogo/protobuf v1.3.1
github.com/gogo/status v1.0.3
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/protobuf v1.4.3
github.com/golang/snappy v0.0.2
github.com/google/uuid v1.1.1
github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3
github.com/google/uuid v1.1.2
github.com/gorilla/mux v1.7.4
github.com/grafana/loki v1.3.0
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
Expand All @@ -28,29 +28,28 @@ require (
github.com/opentracing/opentracing-go v1.2.0
github.com/pierrec/lz4/v4 v4.1.3
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.8.0
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.15.0
github.com/prometheus/prometheus v1.8.2-0.20201119181812-c8f810083d3f
github.com/prometheus/prometheus v1.8.2-0.20210124145330-b5dfa2414b9e
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-20201119133501-0619918236ec
github.com/weaveworks/common v0.0.0-20210112142934-23c8d7fa6120
github.com/willf/bitset v1.1.10 // indirect
github.com/willf/bloom v2.0.3+incompatible
go.opencensus.io v0.22.4
go.opencensus.io v0.22.5
go.opentelemetry.io/collector v0.6.1
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.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
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
google.golang.org/api v0.36.0
google.golang.org/grpc v1.33.2
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
)

Expand All @@ -70,6 +69,7 @@ replace (
github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab
github.com/opentracing-contrib/go-grpc => github.com/pracucci/go-grpc v0.0.0-20201022134131-ef559b8db645
github.com/satori/go.uuid => github.com/satori/go.uuid v1.2.0
k8s.io/api => k8s.io/api v0.19.4
k8s.io/client-go => k8s.io/client-go v0.19.2
)

Expand Down
Loading