Skip to content

Commit

Permalink
update loki to include grafana/loki#3285
Browse files Browse the repository at this point in the history
  • Loading branch information
rfratto committed Feb 5, 2021
1 parent 0870ece commit 9ad0254
Show file tree
Hide file tree
Showing 63 changed files with 529 additions and 471 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ files to the new format.
- [ENHANCEMENT] The `/agent/api/v1/targets` API will now include discovered labels
on the target pre-relabeling in a `discovered_labels` field. (@rfratto)

- [ENHANCEMENT] Update to Cortex v1.7.0-rc.0 (@rfratto)
- [ENHANCEMENT] Update Loki to 59a34f9867ce. This is a non-release build, and was needed
to support multiple Loki instances. (@rfratto)

- [ENHANCEMENT] Scraping service: Unhealthy Agents in the ring will no longer
cause job distribution to fail. (@rfratto)
Expand Down
29 changes: 15 additions & 14 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/grafana/agent/pkg/loki"
"github.com/grafana/agent/pkg/tempo"

"github.com/cortexproject/cortex/pkg/util"
util_log "github.com/cortexproject/cortex/pkg/util/log"
"github.com/go-kit/kit/log/level"
"github.com/grafana/agent/pkg/config"
"github.com/grafana/agent/pkg/prom"
Expand All @@ -40,8 +40,9 @@ func main() {
log.Fatalln(err)
}

// After this point we can use util.Logger and stop using the log package
util.InitLogger(&cfg.Server)
// After this point we can use util_log.Logger and stop using the log package
util_log.InitLogger(&cfg.Server)
logger := util_log.Logger

var (
promMetrics *prom.Agent
Expand All @@ -52,14 +53,14 @@ func main() {

srv, err := server.New(cfg.Server)
if err != nil {
level.Error(util.Logger).Log("msg", "failed to create server", "err", err)
level.Error(logger).Log("msg", "failed to create server", "err", err)
os.Exit(1)
}

if cfg.Prometheus.Enabled {
promMetrics, err = prom.New(prometheus.DefaultRegisterer, cfg.Prometheus, util.Logger)
promMetrics, err = prom.New(prometheus.DefaultRegisterer, cfg.Prometheus, logger)
if err != nil {
level.Error(util.Logger).Log("msg", "failed to create prometheus instance", "err", err)
level.Error(logger).Log("msg", "failed to create prometheus instance", "err", err)
os.Exit(1)
}

Expand All @@ -69,30 +70,30 @@ func main() {
}

if cfg.Loki.Enabled {
lokiLogs, err = loki.New(prometheus.DefaultRegisterer, cfg.Loki, util.Logger)
lokiLogs, err = loki.New(prometheus.DefaultRegisterer, cfg.Loki, logger)
if err != nil {
level.Error(util.Logger).Log("msg", "failed to create loki log collection instance", "err", err)
level.Error(logger).Log("msg", "failed to create loki log collection instance", "err", err)
os.Exit(1)
}
}

if cfg.Tempo.Enabled {
tempoTraces, err = tempo.New(prometheus.DefaultRegisterer, cfg.Tempo, cfg.Server.LogLevel)
if err != nil {
level.Error(util.Logger).Log("msg", "failed to create tempo trace collection instance", "err", err)
level.Error(logger).Log("msg", "failed to create tempo trace collection instance", "err", err)
os.Exit(1)
}
}

if cfg.Integrations.Enabled {
manager, err = integrations.NewManager(cfg.Integrations, util.Logger, promMetrics.InstanceManager())
manager, err = integrations.NewManager(cfg.Integrations, logger, promMetrics.InstanceManager())
if err != nil {
level.Error(util.Logger).Log("msg", "failed to create integrations manager", "err", err)
level.Error(logger).Log("msg", "failed to create integrations manager", "err", err)
os.Exit(1)
}

if err := manager.WireAPI(srv.HTTP); err != nil {
level.Error(util.Logger).Log("msg", "failed wiring endpoints for integrations", "err", err)
level.Error(logger).Log("msg", "failed wiring endpoints for integrations", "err", err)
os.Exit(1)
}
}
Expand All @@ -107,7 +108,7 @@ func main() {
})

if err := srv.Run(); err != nil {
level.Error(util.Logger).Log("msg", "error running agent", "err", err)
level.Error(logger).Log("msg", "error running agent", "err", err)
// Don't os.Exit here; we want to do cleanup by stopping promMetrics
}

Expand All @@ -124,5 +125,5 @@ func main() {
if tempoTraces != nil {
tempoTraces.Stop()
}
level.Info(util.Logger).Log("msg", "agent exiting")
level.Info(logger).Log("msg", "agent exiting")
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ go 1.12
require (
contrib.go.opencensus.io/exporter/prometheus v0.2.0
github.com/aws/aws-sdk-go v1.36.15
github.com/cortexproject/cortex v1.6.1-0.20210129172402-0976147451ee
github.com/cortexproject/cortex v1.6.1-0.20210204145131-7dac81171c66
github.com/drone/envsubst v1.0.2
github.com/go-kit/kit v0.10.0
github.com/go-playground/validator/v10 v10.4.0 // indirect
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.4.3
github.com/google/dnsmasq_exporter v0.0.0-00010101000000-000000000000
github.com/gorilla/mux v1.8.0
github.com/grafana/loki v1.6.2-0.20210203125540-d667dd20f287
github.com/grafana/loki v1.6.2-0.20210205130758-59a34f9867ce
github.com/hashicorp/consul/api v1.8.1
github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect
github.com/joshdk/go-junit v0.0.0-20200702055522-6efcf4050909 // indirect
Expand Down
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,13 @@ github.com/cortexproject/cortex v1.4.1-0.20201022071705-85942c5703cf h1:TGmSZFMN
github.com/cortexproject/cortex v1.4.1-0.20201022071705-85942c5703cf/go.mod h1:MBJnS5mzVcHqivBp2391HpflMeMiT+f8r4VNkJlsZFs=
github.com/cortexproject/cortex v1.4.1-0.20201030080541-83ad6df2abea/go.mod h1:kXo5F3jlF7Ky3+I31jt/bXTzOlQjl2X/vGDpy0RY1gU=
github.com/cortexproject/cortex v1.5.1-0.20201111110551-ba512881b076/go.mod h1:zFBGVsvRBfVp6ARXZ7pmiLaGlbjda5ZnA4Y6qSJyrQg=
github.com/cortexproject/cortex v1.6.1-0.20210108144208-6c2dab103f20/go.mod h1:fOsaeeFSyWrjd9nFJO8KVUpsikcxnYsjEzQyjURBoQk=
github.com/cortexproject/cortex v1.6.1-0.20210121163251-a59b811d5952 h1:6fjboCnRBAp5QevLOeAyDXf1MW4EzzaCTmwZlrOYV0k=
github.com/cortexproject/cortex v1.6.1-0.20210121163251-a59b811d5952/go.mod h1:t7gTMLe7db0dcrKsjoQ5o13Ep16dzqkSepYAkiQLwyU=
github.com/cortexproject/cortex v1.6.1-0.20210129172402-0976147451ee h1:Lj7kPgeuMHzoejxD4QQjYNMDqPNB5Uiqj0GvYaINnG0=
github.com/cortexproject/cortex v1.6.1-0.20210129172402-0976147451ee/go.mod h1:uwptskTaCiJPGHaEsIthCBtnOA1nN+KpLDezYvbvU8o=
github.com/cortexproject/cortex v1.6.1-0.20210204145131-7dac81171c66 h1:ZCpJ2TGDLw5dmDyO0owQLod4f+Q3oRwoqT8WXa1445g=
github.com/cortexproject/cortex v1.6.1-0.20210204145131-7dac81171c66/go.mod h1:hQ45oW8W7SKNBv4bkl1960kWyslLDbL2IWuzCQBCVGY=
github.com/couchbase/go-couchbase v0.0.0-20180501122049-16db1f1fe037/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
github.com/couchbase/gomemcached v0.0.0-20180502221210-0da75df14530/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
Expand Down Expand Up @@ -954,6 +957,8 @@ github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw=
github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 h1:ur2rms48b3Ep1dxh7aUV2FZEQ8jEVO2F6ILKx8ofkAg=
github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM=
Expand Down Expand Up @@ -1114,6 +1119,8 @@ github.com/grafana/loki v1.6.2-0.20210126101127-33abab5e4203 h1:pepaoQed4SpUN2hO
github.com/grafana/loki v1.6.2-0.20210126101127-33abab5e4203/go.mod h1:dhEOXEHU3i9M1YkRkVWKPI/60VjIqcy2hyXVu+9IuQs=
github.com/grafana/loki v1.6.2-0.20210203125540-d667dd20f287 h1:ODZF4Z+FORRcuc87gOy94bWxh3plAFgh1/XJZS6HjBg=
github.com/grafana/loki v1.6.2-0.20210203125540-d667dd20f287/go.mod h1:uhisKVH/w+t39vNKAhGy5mpXS57dKSCcTohvsQv/eOQ=
github.com/grafana/loki v1.6.2-0.20210205130758-59a34f9867ce h1:JAUj0bKdYAXQO3Xthv9w+NORgSgeHnrH3PxsKpiMhpo=
github.com/grafana/loki v1.6.2-0.20210205130758-59a34f9867ce/go.mod h1:zD6R/qL5IP9gfpDHmlxeY3g5c5SuABCxRqOpS9VZ67o=
github.com/grafana/memcached_exporter v0.7.1-0.20201030142623-8e1997d4fbb7 h1:dNnnXHJoiOARawfVU4e/Z2S6uD9bn6oCbTpPLODV6QA=
github.com/grafana/memcached_exporter v0.7.1-0.20201030142623-8e1997d4fbb7/go.mod h1:YCz9i2SVVjyOpN8XJpPWnu6zqXO1qvlWg27qOuY0rd0=
github.com/grafana/mysqld_exporter v0.12.2-0.20201015182516-5ac885b2d38a h1:D5NSR64/6xMXnSFD9y1m1DPYIcBcHvtfeuI9/M/0qtI=
Expand Down Expand Up @@ -2234,6 +2241,8 @@ github.com/thanos-io/thanos v0.13.1-0.20201019130456-f41940581d9a/go.mod h1:A3qU
github.com/thanos-io/thanos v0.13.1-0.20201030101306-47f9a225cc52/go.mod h1:OqqX4x21cg5N5MMHd/yGQAc/V3wg8a7Do4Jk8HfaFZQ=
github.com/thanos-io/thanos v0.13.1-0.20210108102609-f85e4003ba51 h1:cinCqkVci8c5Dg6uB3m3351EjLAXDbwJVFT+bgwu/Ew=
github.com/thanos-io/thanos v0.13.1-0.20210108102609-f85e4003ba51/go.mod h1:kPvI4H0AynFiHDN95ZB28/k70ZPGCx+pBrRh6RZPimw=
github.com/thanos-io/thanos v0.13.1-0.20210204123931-82545cdd16fe h1:YMGaJuBKOK3XtCxxezHClrV2OTImnSdzpMQnXG9nqgw=
github.com/thanos-io/thanos v0.13.1-0.20210204123931-82545cdd16fe/go.mod h1:ZLDGYRNkgM+FCwYNOD+6tOV+DE2fpjzfV6iqXyOgFIw=
github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
Expand Down Expand Up @@ -2309,6 +2318,7 @@ github.com/weaveworks/common v0.0.0-20200625145055-4b1847531bc9 h1:dNVIG9aKQHR9T
github.com/weaveworks/common v0.0.0-20200625145055-4b1847531bc9/go.mod h1:c98fKi5B9u8OsKGiWHLRKus6ToQ1Tubeow44ECO1uxY=
github.com/weaveworks/common v0.0.0-20200914083218-61ffdd448099 h1:MS5M2antM8wzMUqVxIfAi+yb6yjXvDINRFvLnmNXeIw=
github.com/weaveworks/common v0.0.0-20200914083218-61ffdd448099/go.mod h1:hz10LOsAdzC3K/iXaKoFxOKTDRgxJl+BTGX1GY+TzO4=
github.com/weaveworks/common v0.0.0-20201119133501-0619918236ec/go.mod h1:ykzWac1LtVfOxdCK+jD754at1Ws9dKCwFeUzkFBffPs=
github.com/weaveworks/common v0.0.0-20210112142934-23c8d7fa6120 h1:zQtcwREXYNvW116ipgc0bRDg1avD2b6QP0RGPLlPWkc=
github.com/weaveworks/common v0.0.0-20210112142934-23c8d7fa6120/go.mod h1:ykzWac1LtVfOxdCK+jD754at1Ws9dKCwFeUzkFBffPs=
github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M=
Expand Down
4 changes: 2 additions & 2 deletions pkg/prom/ha/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (s *Server) waitNotifyReshard(ctx context.Context) error {
return err
}

_, err = rs.Do(ctx, time.Millisecond*250, func(ctx context.Context, desc *ring.IngesterDesc) (interface{}, error) {
_, err = rs.Do(ctx, time.Millisecond*250, func(ctx context.Context, desc *ring.InstanceDesc) (interface{}, error) {
// Skip over ourselves; we'll reshard locally after this process finishes.
if desc.Addr == s.addr {
return nil, nil
Expand All @@ -282,7 +282,7 @@ func (s *Server) waitNotifyReshard(ctx context.Context) error {
return err
}

func (s *Server) notifyReshard(ctx context.Context, desc *ring.IngesterDesc) error {
func (s *Server) notifyReshard(ctx context.Context, desc *ring.InstanceDesc) error {
cli, err := client.New(s.clientConfig, desc.Addr)
if err != nil {
return err
Expand Down
14 changes: 7 additions & 7 deletions pkg/prom/ha/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestServer_Cluster_Reshard_On_Start_And_Leave(t *testing.T) {
injectRingIngester(r)
r.GetAllHealthyFunc = func(_ ring.Operation) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{
Ingesters: []ring.InstanceDesc{
{Addr: "test"},
agent1Desc,
agent2Desc,
Expand Down Expand Up @@ -191,15 +191,15 @@ func TestServer_Cluster_Reshard_On_Start_And_Leave(t *testing.T) {
}

func injectRingIngester(r *mockFuncReadRing) {
r.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
r.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "test"}},
Ingesters: []ring.InstanceDesc{{Addr: "test"}},
}, nil
}

r.GetAllHealthyFunc = func(_ ring.Operation) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "test"}},
Ingesters: []ring.InstanceDesc{{Addr: "test"}},
}, nil
}
}
Expand Down Expand Up @@ -399,10 +399,10 @@ func (m mockFuncAgentProtoServer) Reshard(ctx context.Context, req *agentproto.R
}

// startScrapingServiceServer launches a gRPC server and registers a ScrapingServiceServer
// against it. The ring.IngesterDesc to add to a ring implementation is returned.
// against it. The ring.InstanceDesc to add to a ring implementation is returned.
//
// The gRPC server will be stopped when the test exits.
func startScrapingServiceServer(t *testing.T, srv agentproto.ScrapingServiceServer) ring.IngesterDesc {
func startScrapingServiceServer(t *testing.T, srv agentproto.ScrapingServiceServer) ring.InstanceDesc {
t.Helper()

l, err := net.Listen("tcp", "127.0.0.1:0")
Expand All @@ -416,7 +416,7 @@ func startScrapingServiceServer(t *testing.T, srv agentproto.ScrapingServiceServ
}()
t.Cleanup(func() { grpcServer.Stop() })

return ring.IngesterDesc{
return ring.InstanceDesc{
Addr: l.Addr().String(),
State: ring.ACTIVE,
Timestamp: math.MaxInt64,
Expand Down
2 changes: 1 addition & 1 deletion pkg/prom/ha/sharding.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (s *Server) AllConfigs(ctx context.Context) (<-chan instance.Config, error)
type ReadRing interface {
http.Handler

Get(key uint32, op ring.Operation, bufDescs []ring.IngesterDesc, bufHosts, bufZones []string) (ring.ReplicationSet, error)
Get(key uint32, op ring.Operation, bufDescs []ring.InstanceDesc, bufHosts, bufZones []string) (ring.ReplicationSet, error)
GetAllHealthy(op ring.Operation) (ring.ReplicationSet, error)
}

Expand Down
36 changes: 18 additions & 18 deletions pkg/prom/ha/sharding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func TestShardingInstanceManager(t *testing.T) {
t.Run("only lists configs applied through sharded instance manager", func(t *testing.T) {
fakeIm := newFakeInstanceManager()
mockRing := &mockFuncReadRing{}
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "same_machine"}},
Ingesters: []ring.InstanceDesc{{Addr: "same_machine"}},
}, nil
}

Expand All @@ -79,9 +79,9 @@ func TestShardingInstanceManager(t *testing.T) {
t.Run("applies owned config", func(t *testing.T) {
fakeIm := newFakeInstanceManager()
mockRing := &mockFuncReadRing{}
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "same_machine"}},
Ingesters: []ring.InstanceDesc{{Addr: "same_machine"}},
}, nil
}

Expand All @@ -94,9 +94,9 @@ func TestShardingInstanceManager(t *testing.T) {
t.Run("ignores apply of unowned config", func(t *testing.T) {
fakeIm := newFakeInstanceManager()
mockRing := &mockFuncReadRing{}
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "remote"}},
Ingesters: []ring.InstanceDesc{{Addr: "remote"}},
}, nil
}

Expand All @@ -111,10 +111,10 @@ func TestShardingInstanceManager(t *testing.T) {

fakeIm := newFakeInstanceManager()
mockRing := &mockFuncReadRing{}
mockRing.GetFunc = func(key uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
mockRing.GetFunc = func(key uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
hashes = append(hashes, key)
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "remote"}},
Ingesters: []ring.InstanceDesc{{Addr: "remote"}},
}, nil
}

Expand All @@ -132,9 +132,9 @@ func TestShardingInstanceManager(t *testing.T) {

fakeIm := newFakeInstanceManager()
mockRing := &mockFuncReadRing{}
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: returnRingAddr}},
Ingesters: []ring.InstanceDesc{{Addr: returnRingAddr}},
}, nil
}

Expand All @@ -153,9 +153,9 @@ func TestShardingInstanceManager(t *testing.T) {
t.Run("doesn't reapply unchanged config", func(t *testing.T) {
fakeIm := newFakeInstanceManager()
mockRing := &mockFuncReadRing{}
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "same_machine"}},
Ingesters: []ring.InstanceDesc{{Addr: "same_machine"}},
}, nil
}

Expand All @@ -174,9 +174,9 @@ func TestShardingInstanceManager(t *testing.T) {
t.Run("reapplies changed config", func(t *testing.T) {
fakeIm := newFakeInstanceManager()
mockRing := &mockFuncReadRing{}
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "same_machine"}},
Ingesters: []ring.InstanceDesc{{Addr: "same_machine"}},
}, nil
}

Expand Down Expand Up @@ -206,9 +206,9 @@ func TestShardingInstanceManager(t *testing.T) {
t.Run("deletes owned config", func(t *testing.T) {
fakeIm := newFakeInstanceManager()
mockRing := &mockFuncReadRing{}
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.IngesterDesc, _, _ []string) (ring.ReplicationSet, error) {
mockRing.GetFunc = func(_ uint32, _ ring.Operation, _ []ring.InstanceDesc, _, _ []string) (ring.ReplicationSet, error) {
return ring.ReplicationSet{
Ingesters: []ring.IngesterDesc{{Addr: "same_machine"}},
Ingesters: []ring.InstanceDesc{{Addr: "same_machine"}},
}, nil
}

Expand Down Expand Up @@ -296,11 +296,11 @@ remote_write:
type mockFuncReadRing struct {
http.Handler

GetFunc func(key uint32, op ring.Operation, bufDescs []ring.IngesterDesc, bufHosts, bufZones []string) (ring.ReplicationSet, error)
GetFunc func(key uint32, op ring.Operation, bufDescs []ring.InstanceDesc, bufHosts, bufZones []string) (ring.ReplicationSet, error)
GetAllHealthyFunc func(ring.Operation) (ring.ReplicationSet, error)
}

func (r *mockFuncReadRing) Get(key uint32, op ring.Operation, bufDescs []ring.IngesterDesc, bufHosts, bufZones []string) (ring.ReplicationSet, error) {
func (r *mockFuncReadRing) Get(key uint32, op ring.Operation, bufDescs []ring.InstanceDesc, bufHosts, bufZones []string) (ring.ReplicationSet, error) {
if r.GetFunc != nil {
return r.GetFunc(key, op, bufDescs, bufHosts, bufZones)
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/tempo/promsdprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ func NewFactory() component.ProcessorFactory {
return processorhelper.NewFactory(
TypeStr,
createDefaultConfig,
processorhelper.WithTraces(createTraceProcessor))
processorhelper.WithTraces(createTraceProcessor),
)
}

func createDefaultConfig() configmodels.Processor {
Expand All @@ -38,7 +39,7 @@ func createDefaultConfig() configmodels.Processor {

func createTraceProcessor(
_ context.Context,
_ component.ProcessorCreateParams,
cp component.ProcessorCreateParams,
cfg configmodels.Processor,
nextConsumer consumer.TracesConsumer,
) (component.TracesProcessor, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/tempo/promsdprocessor/prom_sd_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"sync"

"github.com/cortexproject/cortex/pkg/util"
util "github.com/cortexproject/cortex/pkg/util/log"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/prometheus/common/model"
Expand Down
Loading

0 comments on commit 9ad0254

Please sign in to comment.