Skip to content

Migrating from go-kit/kit/log to the slimmer go-kit/log #4421

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

Merged
merged 3 commits into from
Sep 29, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .errcheck-exclude
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
io/ioutil.WriteFile
io/ioutil.ReadFile
(github.com/go-kit/kit/log.Logger).Log
(github.com/go-kit/log.Logger).Log
io.Copy
(github.com/opentracing/opentracing-go.Tracer).Inject
(*github.com/cortexproject/cortex/pkg/util/spanlogger.SpanLogger).Error
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ linters:
- golint
- gofmt
- misspell
- depguard

linters-settings:
errcheck:
Expand All @@ -16,6 +17,12 @@ linters-settings:
goimports:
local-prefixes: "github.com/cortexproject/cortex"

depguard:
list-type: blacklist
include-go-root: true
packages-with-error-message:
- github.com/go-kit/kit/log: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"

run:
timeout: 5m

Expand Down
2 changes: 1 addition & 1 deletion cmd/blocksconvert/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"strings"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/services"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/server"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cortex/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"time"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion cmd/query-tee/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"flag"
"os"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/weaveworks/common/logging"
Expand Down
2 changes: 1 addition & 1 deletion cmd/test-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math"
"time"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/server"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb
github.com/felixge/fgprof v0.9.1
github.com/fsouza/fake-gcs-server v1.7.0
github.com/go-kit/kit v0.11.0
github.com/go-kit/log v0.1.0
github.com/go-openapi/strfmt v0.20.1
github.com/go-openapi/swag v0.19.15
github.com/go-redis/redis/v8 v8.9.0
Expand Down
2 changes: 1 addition & 1 deletion integration/e2e/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
)

// Global logger to use in integration tests. We use a global logger to simplify
Expand Down
2 changes: 1 addition & 1 deletion integration/e2e/scenario_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/thanos-io/thanos/pkg/objstore/s3"
Expand Down
2 changes: 1 addition & 1 deletion integration/e2e/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/grafana/dskit/backoff"
"github.com/pkg/errors"
"github.com/prometheus/common/expfmt"
Expand Down
2 changes: 1 addition & 1 deletion integration/e2ecortex/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/grafana/dskit/flagext"
"github.com/oklog/ulid"
"github.com/thanos-io/thanos/pkg/objstore"
Expand Down
2 changes: 1 addition & 1 deletion integration/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/grafana/dskit/kv"
"github.com/grafana/dskit/kv/consul"
"github.com/grafana/dskit/kv/etcd"
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"sync"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/services"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanager_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"flag"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanager_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"
"text/template"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/services"

util_log "github.com/cortexproject/cortex/pkg/util/log"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanager_http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/alertmanager/cluster"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanager_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"time"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/kv"

Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/alertmanager/config"
"github.com/prometheus/alertmanager/types"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertstore/bucketclient/bucket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"sync"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/gogo/protobuf/proto"
"github.com/pkg/errors"
"github.com/thanos-io/thanos/pkg/objstore"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertstore/objectclient/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"sync"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/pkg/errors"
"github.com/thanos-io/thanos/pkg/runutil"

Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"

"github.com/cortexproject/cortex/pkg/alertmanager/alertspb"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/alertstore/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"testing"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/alertmanager/cluster/clusterpb"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/cortexproject/cortex/pkg/util/concurrency"
util_log "github.com/cortexproject/cortex/pkg/util/log"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/pkg/errors"
"github.com/prometheus/alertmanager/config"
"github.com/prometheus/alertmanager/template"
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 @@ -9,7 +9,7 @@ import (
"net/http/httptest"
"testing"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/gorilla/mux"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/services"
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"strings"
"sync"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/services"
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/distributor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/kv"
"github.com/grafana/dskit/kv/consul"
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/multitenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"sync"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/kv"
"github.com/grafana/dskit/services"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/multitenant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/kv/consul"
"github.com/grafana/dskit/services"
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/state_persister.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"flag"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/services"
"github.com/pkg/errors"
"github.com/prometheus/alertmanager/cluster/clusterpb"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/state_persister_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/grafana/dskit/services"
"github.com/prometheus/alertmanager/cluster/clusterpb"
"github.com/stretchr/testify/assert"
Expand Down
4 changes: 2 additions & 2 deletions pkg/alertmanager/state_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/services"
"github.com/pkg/errors"
"github.com/prometheus/alertmanager/cluster"
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/state_replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/grafana/dskit/services"
"github.com/prometheus/alertmanager/cluster/clusterpb"
"github.com/prometheus/client_golang/prometheus"
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/NYTimes/gziphandler"
"github.com/felixge/fgprof"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/storage"
"github.com/weaveworks/common/middleware"
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"regexp"
"sync"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand Down
4 changes: 2 additions & 2 deletions pkg/chunk/aws/dynamodb_index_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/dynamodb"
gklog "github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
gklog "github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sync/errgroup"
Expand Down
2 changes: 1 addition & 1 deletion pkg/chunk/aws/dynamodb_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/backoff"
ot "github.com/opentracing/opentracing-go"
otlog "github.com/opentracing/opentracing-go/log"
Expand Down
2 changes: 1 addition & 1 deletion pkg/chunk/aws/dynamodb_table_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/grafana/dskit/backoff"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion pkg/chunk/aws/metrics_autoscaling.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/pkg/errors"
promApi "github.com/prometheus/client_golang/api"
promV1 "github.com/prometheus/client_golang/api/prometheus/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/chunk/aws/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3iface"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"

util_log "github.com/cortexproject/cortex/pkg/util/log"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/chunk/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"flag"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/chunk/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/stretchr/testify/require"
Expand Down
Loading