Skip to content

Commit

Permalink
Upgrade dskit to remove dependency on weaveworks/common (#5672)
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskorn authored Aug 4, 2023
1 parent fa415b0 commit ff4a68a
Show file tree
Hide file tree
Showing 181 changed files with 1,060 additions and 1,001 deletions.
6 changes: 3 additions & 3 deletions cmd/metaconvert/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
gklog "github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
dslog "github.com/grafana/dskit/log"
"github.com/pkg/errors"
"github.com/thanos-io/objstore"
"github.com/weaveworks/common/logging"
"golang.org/x/exp/slices"

"github.com/grafana/mimir/pkg/storage/bucket"
Expand All @@ -31,8 +31,8 @@ import (
)

type config struct {
LogLevel logging.Level
LogFormat logging.Format
LogLevel dslog.Level
LogFormat dslog.Format
BucketConfig bucket.Config
DryRun bool
Tenant string
Expand Down
8 changes: 4 additions & 4 deletions cmd/mimir-continuous-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (

"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/log"
"github.com/grafana/dskit/server"
"github.com/grafana/dskit/tracing"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/weaveworks/common/logging"
"github.com/weaveworks/common/server"
"github.com/weaveworks/common/tracing"

"github.com/grafana/mimir/pkg/continuoustest"
"github.com/grafana/mimir/pkg/util/instrumentation"
Expand All @@ -24,7 +24,7 @@ import (

type Config struct {
ServerMetricsPort int
LogLevel logging.Level
LogLevel log.Level
Client continuoustest.ClientConfig
Manager continuoustest.ManagerConfig
WriteReadSeriesTest continuoustest.WriteReadSeriesTestConfig
Expand Down
2 changes: 1 addition & 1 deletion cmd/mimir/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (

"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/tracing"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/tracing"
"gopkg.in/yaml.v3"

"github.com/grafana/mimir/pkg/mimir"
Expand Down
6 changes: 3 additions & 3 deletions cmd/query-tee/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/log"
"github.com/grafana/dskit/server"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/weaveworks/common/logging"
"github.com/weaveworks/common/server"

"github.com/grafana/mimir/pkg/util/instrumentation"
util_log "github.com/grafana/mimir/pkg/util/log"
Expand All @@ -24,7 +24,7 @@ import (

type Config struct {
ServerMetricsPort int
LogLevel logging.Level
LogLevel log.Level
ProxyConfig querytee.ProxyConfig
PathPrefix string
}
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/golang/snappy v0.0.4
github.com/google/gopacket v1.1.19
github.com/gorilla/mux v1.8.0
github.com/grafana/dskit v0.0.0-20230731140248-b62b4b2ca7b2
github.com/grafana/dskit v0.0.0-20230804003603-740f56bd2934
github.com/grafana/e2e v0.1.1-0.20230221201045-21ebba73580b
github.com/hashicorp/golang-lru v0.6.0
github.com/json-iterator/go v1.1.12
Expand All @@ -38,7 +38,6 @@ require (
github.com/spf13/afero v1.9.5
github.com/stretchr/testify v1.8.4
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/weaveworks/common v0.0.0-20230728070032-dd9e68f319d5
go.uber.org/atomic v1.11.0
go.uber.org/goleak v1.2.1
golang.org/x/crypto v0.11.0
Expand Down
38 changes: 2 additions & 36 deletions go.sum

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions pkg/alertmanager/alertmanagerpb/alertmanager.pb.go

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

2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanagerpb/alertmanager.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "gogoproto/gogo.proto";

option go_package = "alertmanagerpb";

import "github.com/weaveworks/common/httpgrpc/httpgrpc.proto";
import "github.com/grafana/dskit/httpgrpc/httpgrpc.proto";
import "github.com/prometheus/alertmanager/cluster/clusterpb/cluster.proto";

// Alertmanager interface exposed to the Alertmanager Distributor and other Alertmanagers
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import (
"github.com/go-kit/log"
"github.com/gorilla/mux"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/user"
"github.com/pkg/errors"
"github.com/prometheus/alertmanager/config"
"github.com/prometheus/client_golang/prometheus"
commoncfg "github.com/prometheus/common/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/thanos-io/objstore"
"github.com/weaveworks/common/user"

"github.com/grafana/mimir/pkg/alertmanager/alertspb"
"github.com/grafana/mimir/pkg/alertmanager/alertstore/bucketclient"
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import (

"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/httpgrpc"
"github.com/grafana/dskit/ring"
"github.com/grafana/dskit/ring/client"
"github.com/grafana/dskit/services"
"github.com/grafana/dskit/tenant"
"github.com/grafana/dskit/user"
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/httpgrpc"
"github.com/weaveworks/common/user"

"github.com/grafana/mimir/pkg/alertmanager/merger"
"github.com/grafana/mimir/pkg/util"
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/distributor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ import (

"github.com/go-kit/log"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/httpgrpc"
"github.com/grafana/dskit/kv"
"github.com/grafana/dskit/kv/consul"
"github.com/grafana/dskit/ring"
"github.com/grafana/dskit/services"
"github.com/grafana/dskit/test"
"github.com/grafana/dskit/user"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/weaveworks/common/httpgrpc"
"github.com/weaveworks/common/user"
"google.golang.org/grpc"
"google.golang.org/grpc/health/grpc_health_v1"

Expand Down
6 changes: 3 additions & 3 deletions pkg/alertmanager/multitenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ import (
"github.com/go-kit/log/level"
"github.com/grafana/dskit/concurrency"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/httpgrpc"
"github.com/grafana/dskit/httpgrpc/server"
"github.com/grafana/dskit/kv"
"github.com/grafana/dskit/ring"
"github.com/grafana/dskit/ring/client"
"github.com/grafana/dskit/services"
"github.com/grafana/dskit/tenant"
"github.com/grafana/dskit/user"
"github.com/pkg/errors"
"github.com/prometheus/alertmanager/cluster/clusterpb"
amconfig "github.com/prometheus/alertmanager/config"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/weaveworks/common/httpgrpc"
"github.com/weaveworks/common/httpgrpc/server"
"github.com/weaveworks/common/user"
"golang.org/x/time/rate"
"gopkg.in/yaml.v3"

Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/multitenant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ import (
"github.com/go-kit/log"
"github.com/grafana/dskit/concurrency"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/httpgrpc"
"github.com/grafana/dskit/kv/consul"
dskit_metrics "github.com/grafana/dskit/metrics"
"github.com/grafana/dskit/ring"
"github.com/grafana/dskit/services"
"github.com/grafana/dskit/test"
"github.com/grafana/dskit/user"
"github.com/grafana/regexp"
"github.com/prometheus/alertmanager/cluster/clusterpb"
amconfig "github.com/prometheus/alertmanager/config"
Expand All @@ -43,8 +45,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/thanos-io/objstore"
"github.com/weaveworks/common/httpgrpc"
"github.com/weaveworks/common/user"
"go.uber.org/atomic"
"golang.org/x/time/rate"
"google.golang.org/grpc"
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"github.com/go-kit/log/level"
"github.com/gorilla/mux"
"github.com/grafana/dskit/kv/memberlist"
"github.com/grafana/dskit/middleware"
"github.com/grafana/dskit/server"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/middleware"
"github.com/weaveworks/common/server"

"github.com/grafana/mimir/pkg/alertmanager"
"github.com/grafana/mimir/pkg/alertmanager/alertmanagerpb"
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

"github.com/go-kit/log"
"github.com/gorilla/mux"
"github.com/grafana/dskit/server"
"github.com/stretchr/testify/require"
"github.com/weaveworks/common/server"

"github.com/grafana/mimir/pkg/util/gziphandler"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/error/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"fmt"
"net/http"

"github.com/weaveworks/common/httpgrpc"
"github.com/grafana/dskit/httpgrpc"
)

type Type string
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import (

"github.com/go-kit/log"
"github.com/gorilla/mux"
"github.com/grafana/dskit/instrument"
"github.com/grafana/dskit/kv/memberlist"
"github.com/grafana/dskit/middleware"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand All @@ -28,8 +30,6 @@ import (
"github.com/prometheus/prometheus/promql"
"github.com/prometheus/prometheus/storage"
v1 "github.com/prometheus/prometheus/web/api/v1"
"github.com/weaveworks/common/instrument"
"github.com/weaveworks/common/middleware"

"github.com/grafana/mimir/pkg/querier"
"github.com/grafana/mimir/pkg/querier/stats"
Expand Down
2 changes: 1 addition & 1 deletion pkg/compactor/block_upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/go-kit/log"
"github.com/gorilla/mux"
"github.com/grafana/dskit/test"
"github.com/grafana/dskit/user"
"github.com/oklog/ulid"
"github.com/pkg/errors"
"github.com/prometheus/prometheus/model/labels"
Expand All @@ -31,7 +32,6 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/thanos-io/objstore"
"github.com/weaveworks/common/user"

"github.com/grafana/mimir/pkg/storage/bucket"
mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb"
Expand Down
2 changes: 1 addition & 1 deletion pkg/compactor/tenant_deletion_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"testing"

"github.com/grafana/dskit/services"
"github.com/grafana/dskit/user"
"github.com/stretchr/testify/require"
"github.com/thanos-io/objstore"
"github.com/weaveworks/common/user"

"github.com/grafana/mimir/pkg/storage/tsdb"
)
Expand Down
8 changes: 4 additions & 4 deletions pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ import (

"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/httpgrpc"
"github.com/grafana/dskit/instrument"
"github.com/grafana/dskit/kv"
"github.com/grafana/dskit/limiter"
"github.com/grafana/dskit/mtime"
"github.com/grafana/dskit/ring"
ring_client "github.com/grafana/dskit/ring/client"
"github.com/grafana/dskit/services"
"github.com/grafana/dskit/tenant"
"github.com/grafana/dskit/user"
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand All @@ -31,10 +35,6 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/relabel"
"github.com/prometheus/prometheus/scrape"
"github.com/weaveworks/common/httpgrpc"
"github.com/weaveworks/common/instrument"
"github.com/weaveworks/common/mtime"
"github.com/weaveworks/common/user"
"go.uber.org/atomic"
"golang.org/x/exp/slices"
"golang.org/x/sync/errgroup"
Expand Down
Loading

0 comments on commit ff4a68a

Please sign in to comment.