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

Revendor cortex #2427

Merged
merged 2 commits into from
Jul 28, 2020
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
  •  
  •  
  •  
17 changes: 7 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/cespare/xxhash/v2 v2.1.1
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448 // indirect
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/cortexproject/cortex v1.2.1-0.20200709155522-19502213923d
github.com/cortexproject/cortex v1.2.1-0.20200727121049-4cfa4a2978c2
github.com/davecgh/go-spew v1.1.1
github.com/docker/docker v17.12.0-ce-rc1.0.20200706150819-a40b877fbb9e+incompatible
github.com/docker/go-metrics v0.0.0-20181218153428-b84716841b82 // indirect
Expand Down Expand Up @@ -38,24 +38,23 @@ require (
github.com/klauspost/compress v1.9.5
github.com/mitchellh/mapstructure v1.2.2
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
github.com/opentracing/opentracing-go v1.1.1-0.20200124165624-2876d2018785
github.com/opentracing/opentracing-go v1.2.0
github.com/pierrec/lz4 v2.5.3-0.20200429092203-e876bbd321b3+incompatible
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.10.0
github.com/prometheus/prometheus v1.8.2-0.20200707115909-30505a202a4c
github.com/prometheus/prometheus v1.8.2-0.20200727090838-6f296594a852
github.com/segmentio/fasthash v1.0.2
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/shurcooL/vfsgen v0.0.0-20200627165143-92b8a710ab6c
github.com/stretchr/testify v1.5.1
github.com/tonistiigi/fifo v0.0.0-20190226154929-a9fb20d87448
github.com/uber/jaeger-client-go v2.23.1+incompatible
github.com/uber/jaeger-client-go v2.25.0+incompatible
github.com/ugorji/go v1.1.7 // indirect
github.com/weaveworks/common v0.0.0-20200512154658-384f10054ec5
github.com/weaveworks/common v0.0.0-20200625145055-4b1847531bc9
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50
golang.org/x/net v0.0.0-20200602114024-627f9648deb9
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect
golang.org/x/net v0.0.0-20200707034311-ab3426394381
google.golang.org/grpc v1.29.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/fsnotify.v1 v1.4.7
Expand All @@ -67,8 +66,6 @@ replace github.com/hpcloud/tail => github.com/grafana/tail v0.0.0-20191024143944

replace github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v36.2.0+incompatible

replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.0+incompatible

replace k8s.io/client-go => k8s.io/client-go v0.18.3

// >v1.2.0 has some conflict with prometheus/alertmanager. Hence prevent the upgrade till it's fixed.
Expand Down
113 changes: 105 additions & 8 deletions go.sum

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ func (t *Loki) initRuntimeConfig() (services.Service, error) {
t.cfg.RuntimeConfig.LoadPath = t.cfg.LimitsConfig.PerTenantOverrideConfig
t.cfg.RuntimeConfig.ReloadPeriod = t.cfg.LimitsConfig.PerTenantOverridePeriod
}

if t.cfg.RuntimeConfig.LoadPath == "" {
// no need to initialize module if load path is empty
return nil, nil
}

t.cfg.RuntimeConfig.Loader = loadRuntimeConfig

// make sure to set default limits before we start loading configuration into memory
Expand Down Expand Up @@ -226,7 +232,7 @@ func (t *Loki) initTableManager() (services.Service, error) {
os.Exit(1)
}

tableClient, err := storage.NewTableClient(lastConfig.IndexType, t.cfg.StorageConfig.Config)
tableClient, err := storage.NewTableClient(lastConfig.IndexType, t.cfg.StorageConfig.Config, prometheus.DefaultRegisterer)
if err != nil {
return nil, err
}
Expand Down
11 changes: 3 additions & 8 deletions pkg/loki/runtime_config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package loki

import (
"os"
"io"

"github.com/cortexproject/cortex/pkg/ring/kv"
"github.com/cortexproject/cortex/pkg/util/runtimeconfig"
Expand All @@ -19,15 +19,10 @@ type runtimeConfigValues struct {
Multi kv.MultiRuntimeConfig `yaml:"multi_kv_config"`
}

func loadRuntimeConfig(filename string) (interface{}, error) {
f, err := os.Open(filename)
if err != nil {
return nil, err
}

func loadRuntimeConfig(r io.Reader) (interface{}, error) {
var overrides = &runtimeConfigValues{}

decoder := yaml.NewDecoder(f)
decoder := yaml.NewDecoder(r)
decoder.SetStrict(true)
if err := decoder.Decode(&overrides); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewTableClient(name string, cfg Config) (chunk.TableClient, error) {
name = "boltdb"
cfg.FSConfig = cortex_local.FSConfig{Directory: cfg.BoltDBShipperConfig.ActiveIndexDirectory}
}
return storage.NewTableClient(name, cfg.Config)
return storage.NewTableClient(name, cfg.Config, prometheus.DefaultRegisterer)
}

// decodeReq sanitizes an incoming request, rounds bounds, appends the __name__ matcher,
Expand Down
4 changes: 4 additions & 0 deletions pkg/storage/stores/util/object_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func (p PrefixedObjectClient) Stop() {
p.downstreamClient.Stop()
}

func (p PrefixedObjectClient) PathSeparator() string {
return p.downstreamClient.PathSeparator()
}

func NewPrefixedObjectClient(downstreamClient chunk.ObjectClient, prefix string) chunk.ObjectClient {
return PrefixedObjectClient{downstreamClient: downstreamClient, prefix: prefix}
}
32 changes: 32 additions & 0 deletions vendor/github.com/Azure/go-autorest/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading