Skip to content

Commit

Permalink
Upgrade dskit and remove dependency on weaveworks/common (#10220)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:

This PR upgrades `github.com/grafana/dskit` removes Loki's dependency on
`github.com/weaveworks/common`.

The changes in dskit, apart from the migration
(grafana/dskit#356), are:

* grafana/dskit#347 
* grafana/dskit#349, which required small
changes in `pkg/canary/reader/reader.go` and `pkg/canary/writer/push.go`
* grafana/dskit#352
* grafana/dskit#354

**Which issue(s) this PR fixes**:

(none)

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [n/a] Documentation added
- [n/a] Tests updated
- [n/a] `CHANGELOG.md` updated
- [n/a] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [n/a] Changes that require user attention or interaction to upgrade
are documented in `docs/sources/setup/upgrade/_index.md`
- [n/a] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e)

---------

Co-authored-by: Michel Hollands <42814411+MichelHollands@users.noreply.github.com>
  • Loading branch information
charleskorn and MichelHollands committed Aug 14, 2023
1 parent 0de80fc commit 8e6a543
Show file tree
Hide file tree
Showing 31 changed files with 855 additions and 555 deletions.
12 changes: 12 additions & 0 deletions docs/sources/configure/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ Configures the `server` of the launched module(s).
[tls_min_version: <string> | default = ""]
http_tls_config:
[cert: <string> | default = ""]
[key: <string> | default = ""]
[client_ca: <string> | default = ""]
# HTTP server cert path.
# CLI flag: -server.http-tls-cert-path
[cert_file: <string> | default = ""]
Expand All @@ -282,6 +288,12 @@ http_tls_config:
[client_ca_file: <string> | default = ""]
grpc_tls_config:
[cert: <string> | default = ""]
[key: <string> | default = ""]
[client_ca: <string> | default = ""]
# GRPC TLS server cert path.
# CLI flag: -server.grpc-tls-cert-path
[cert_file: <string> | default = ""]
Expand Down
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/Workiva/go-datastructures v1.1.0
github.com/alicebob/miniredis/v2 v2.30.4
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/aws/aws-sdk-go v1.44.315
github.com/aws/aws-sdk-go v1.44.321
github.com/baidubce/bce-sdk-go v0.9.141
github.com/bmatcuk/doublestar v1.3.4
github.com/buger/jsonparser v1.1.1
Expand Down Expand Up @@ -49,7 +49,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
github.com/grafana/dskit v0.0.0-20230804003603-740f56bd2934
github.com/grafana/dskit v0.0.0-20230811062909-a2c425ae7975
github.com/grafana/go-gelf/v2 v2.0.1
github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd
Expand Down Expand Up @@ -84,7 +84,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
github.com/prometheus/client_model v0.4.0
github.com/prometheus/common v0.43.0
github.com/prometheus/common v0.44.0
github.com/prometheus/prometheus v0.43.1-0.20230419161410-69155c6ba1e9
github.com/segmentio/fasthash v1.0.3
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
Expand All @@ -94,14 +94,13 @@ require (
github.com/stretchr/testify v1.8.2
github.com/tonistiigi/fifo v0.0.0-20190226154929-a9fb20d87448
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/weaveworks/common v0.0.0-20230511094633-334485600903
github.com/xdg-go/scram v1.1.2
go.etcd.io/bbolt v1.3.6
go.uber.org/atomic v1.11.0
go.uber.org/goleak v1.2.1
golang.org/x/crypto v0.11.0
golang.org/x/net v0.12.0
golang.org/x/sync v0.2.0
golang.org/x/sync v0.3.0
golang.org/x/sys v0.10.0
golang.org/x/time v0.3.0
google.golang.org/api v0.126.0
Expand Down Expand Up @@ -271,7 +270,7 @@ require (
github.com/oschwald/maxminddb-golang v1.10.0 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/exporter-toolkit v0.9.1 // indirect
github.com/prometheus/exporter-toolkit v0.10.1-0.20230714054209-2f4150c63f97 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rootless-containers/rootlesskit v1.1.0 // indirect
Expand Down
46 changes: 10 additions & 36 deletions go.sum

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion pkg/canary/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ func NewReader(writer io.Writer,
httpClient := http.DefaultClient
if tlsConfig != nil && (certFile != "" || keyFile != "" || caFile != "") {
// For the mTLS case, use a http.Client configured with the client side certificates.
rt, err := config.NewTLSRoundTripper(tlsConfig, caFile, certFile, keyFile, func(tls *tls.Config) (http.RoundTripper, error) {
tlsSettings := config.TLSRoundTripperSettings{
CAFile: caFile,
CertFile: certFile,
KeyFile: keyFile,
}
rt, err := config.NewTLSRoundTripper(tlsConfig, tlsSettings, func(tls *tls.Config) (http.RoundTripper, error) {
return &http.Transport{TLSClientConfig: tls}, nil
})
if err != nil {
Expand Down
7 changes: 6 additions & 1 deletion pkg/canary/writer/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ func NewPush(

// setup tls transport
if tlsCfg != nil {
rt, err := config.NewTLSRoundTripper(tlsCfg, caFile, certFile, keyFile, func(tls *tls.Config) (http.RoundTripper, error) {
tlsSettings := config.TLSRoundTripperSettings{
CAFile: caFile,
CertFile: certFile,
KeyFile: keyFile,
}
rt, err := config.NewTLSRoundTripper(tlsCfg, tlsSettings, func(tls *tls.Config) (http.RoundTripper, error) {
return &http.Transport{TLSClientConfig: tls}, nil
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/chunk/client/aws/dynamodb_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import (
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
"github.com/go-kit/log/level"
awscommon "github.com/grafana/dskit/aws"
"github.com/grafana/dskit/backoff"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/instrument"
ot "github.com/opentracing/opentracing-go"
otlog "github.com/opentracing/opentracing-go/log"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
awscommon "github.com/weaveworks/common/aws"
"golang.org/x/time/rate"

"github.com/grafana/loki/pkg/storage/chunk"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/chunk/client/aws/s3_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
v4 "github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3iface"
awscommon "github.com/grafana/dskit/aws"
"github.com/grafana/dskit/backoff"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/instrument"
"github.com/minio/minio-go/v7/pkg/signer"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
awscommon "github.com/weaveworks/common/aws"

bucket_s3 "github.com/grafana/loki/pkg/storage/bucket/s3"
"github.com/grafana/loki/pkg/storage/chunk/client"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/stores/composite_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (

"github.com/grafana/loki/pkg/logproto"

"github.com/grafana/dskit/test"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"github.com/weaveworks/common/test"

"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/chunk/fetcher"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/stores/series/series_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (

"github.com/go-kit/log"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/test"
"github.com/grafana/dskit/user"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/promql/parser"
"github.com/stretchr/testify/require"
"github.com/weaveworks/common/test"

"github.com/grafana/loki/pkg/ingester/client"
"github.com/grafana/loki/pkg/logqlmodel/stats"
Expand Down
81 changes: 81 additions & 0 deletions vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/aws/aws-sdk-go/aws/version.go

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

Loading

0 comments on commit 8e6a543

Please sign in to comment.