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

Chore: Use services and modules from grafana/dskit #4196

Merged
merged 4 commits into from
Aug 27, 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
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions clients/pkg/promtail/promtail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ import (
"github.com/prometheus/prometheus/promql/parser"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
serverww "github.com/weaveworks/common/server"

"github.com/grafana/loki/clients/pkg/logentry/stages"
"github.com/grafana/loki/clients/pkg/promtail/client"
"github.com/grafana/loki/clients/pkg/promtail/config"
"github.com/grafana/loki/clients/pkg/promtail/positions"
"github.com/grafana/loki/clients/pkg/promtail/scrapeconfig"
"github.com/grafana/loki/clients/pkg/promtail/server"
file2 "github.com/grafana/loki/clients/pkg/promtail/targets/file"

"github.com/grafana/loki/pkg/logproto"
Expand Down Expand Up @@ -647,8 +649,20 @@ func Test_DryRun(t *testing.T) {
_, err = New(config.Config{}, true)
require.Error(t, err)

// Set the minimum config needed to start a server. We need to do this since we
// aren't doing any CLI parsing ala RegisterFlags and thus don't get the defaults.
// Required because a hardcoded value became a configuration setting in this commit
// https://github.com/weaveworks/common/commit/c44eeb028a671c5931b047976f9a0171910571ce
serverCfg := server.Config{
Config: serverww.Config{
HTTPListenNetwork: serverww.DefaultNetwork,
GRPCListenNetwork: serverww.DefaultNetwork,
},
}

prometheus.DefaultRegisterer = prometheus.NewRegistry() // reset registry, otherwise you can't create 2 weavework server.
_, err = New(config.Config{
ServerConfig: serverCfg,
ClientConfig: client.Config{URL: flagext.URLValue{URL: &url.URL{Host: "string"}}},
PositionsConfig: positions.Config{
PositionsFile: f.Name(),
Expand All @@ -660,6 +674,7 @@ func Test_DryRun(t *testing.T) {
prometheus.DefaultRegisterer = prometheus.NewRegistry()

p, err := New(config.Config{
ServerConfig: serverCfg,
ClientConfig: client.Config{URL: flagext.URLValue{URL: &url.URL{Host: "string"}}},
PositionsConfig: positions.Config{
PositionsFile: f.Name(),
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/cespare/xxhash v1.1.0
github.com/cespare/xxhash/v2 v2.1.1
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/cortexproject/cortex v1.10.1-0.20210818115638-df9af3a99954
github.com/cortexproject/cortex v1.10.1-0.20210819151536-bcf15611345d
github.com/davecgh/go-spew v1.1.1
github.com/docker/docker v20.10.7+incompatible
github.com/docker/go-plugins-helpers v0.0.0-20181025120712-1e6269c305b8
Expand All @@ -40,15 +40,15 @@ require (
github.com/gofrs/uuid v4.0.0+incompatible
github.com/gogo/protobuf v1.3.2 // remember to update loki-build-image/Dockerfile too
github.com/golang/protobuf v1.5.2
github.com/golang/snappy v0.0.3
github.com/golang/snappy v0.0.4
github.com/google/go-cmp v0.5.6
github.com/gorilla/mux v1.7.3
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.4.2
github.com/grafana/dskit v0.0.0-20210817085554-1b69d2de136f
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
github.com/grafana/dskit v0.0.0-20210819132858-471020752967
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20191002090509-6af20e3a5340 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
github.com/hashicorp/consul/api v1.8.1
github.com/hashicorp/consul/api v1.9.1
github.com/hashicorp/golang-lru v0.5.4
github.com/hpcloud/tail v1.0.0
github.com/imdario/mergo v0.3.11
Expand Down Expand Up @@ -80,21 +80,21 @@ require (
github.com/sony/gobreaker v0.4.1
github.com/spf13/afero v1.2.2
github.com/stretchr/testify v1.7.0
github.com/thanos-io/thanos v0.19.1-0.20210729154440-aa148f8fdb28
github.com/thanos-io/thanos v0.22.0
github.com/tonistiigi/fifo v0.0.0-20190226154929-a9fb20d87448
github.com/uber/jaeger-client-go v2.29.1+incompatible
github.com/ugorji/go v1.1.7 // indirect
github.com/weaveworks/common v0.0.0-20210506120931-f2676019da11
go.etcd.io/bbolt v1.3.5
github.com/weaveworks/common v0.0.0-20210722103813-e649eff5ab4a
go.etcd.io/bbolt v1.3.6
go.uber.org/atomic v1.9.0
go.uber.org/goleak v1.1.10
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6
google.golang.org/api v0.48.0
google.golang.org/grpc v1.38.0
google.golang.org/api v0.50.0
google.golang.org/grpc v1.39.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/fsnotify.v1 v1.4.7
gopkg.in/yaml.v2 v2.4.0
Expand Down
Loading