Skip to content

Commit

Permalink
Update all Go dependencies to latest versions (#528)
Browse files Browse the repository at this point in the history
* Update all Go dependencies to latest versions

* Update all import paths for Go deps

* Fix unit tests and use new grpc insecure transport
  • Loading branch information
metalmatze authored Jan 6, 2022
1 parent 93b96f7 commit 3be8c67
Show file tree
Hide file tree
Showing 33 changed files with 852 additions and 304 deletions.
62 changes: 33 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,58 @@ module github.com/parca-dev/parca
go 1.16

require (
github.com/alecthomas/kong v0.2.17
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/alecthomas/kong v0.3.0
github.com/cenkalti/backoff/v4 v4.1.2
github.com/cespare/xxhash/v2 v2.1.2
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v3 v3.2103.2
github.com/dgraph-io/sroar v0.0.0-20210915181338-8dc690a08d84
github.com/gin-gonic/gin v1.7.0 // indirect
github.com/dgraph-io/sroar v0.0.0-20211209113350-3e3f1b382a64
github.com/gin-gonic/gin v1.7.7 // indirect
github.com/go-chi/cors v1.2.0
github.com/go-delve/delve v1.7.2
github.com/go-kit/log v0.1.0
github.com/go-delve/delve v1.8.0
github.com/go-kit/log v0.2.0
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/goburrow/cache v0.1.4
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1
github.com/google/uuid v1.1.2
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd
github.com/google/uuid v1.3.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/go-grpc-middleware/providers/kit/v2 v2.0.0-20201002093600-73cf2ae9d891
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20201207153454-9f6bf00c00a7
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0
github.com/hashicorp/go-multierror v1.1.0
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639
github.com/improbable-eng/grpc-web v0.14.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2
github.com/hashicorp/go-multierror v1.1.1
github.com/ianlancetaylor/demangle v0.0.0-20211126204342-3ad08eb09c01
github.com/improbable-eng/grpc-web v0.15.0
github.com/oklog/run v1.1.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/common v0.30.0
github.com/prometheus/prometheus v2.5.0+incompatible
github.com/prometheus/common v0.32.1
github.com/prometheus/prometheus v1.8.2-0.20211217191541-41f1a8125e66
github.com/stretchr/testify v1.7.0
github.com/thanos-io/thanos v0.23.1
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.24.0
go.opentelemetry.io/otel v1.0.1
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.0.1
go.opentelemetry.io/otel/sdk v1.0.1
go.opentelemetry.io/otel/trace v1.0.1
github.com/thanos-io/thanos v0.24.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0
go.opentelemetry.io/otel v1.3.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0
go.opentelemetry.io/otel/sdk v1.3.0
go.opentelemetry.io/otel/trace v1.3.0
go.uber.org/atomic v1.9.0
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985
golang.org/x/net v0.0.0-20220105145211-5b0dc2dfae98
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83
google.golang.org/grpc v1.41.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
google.golang.org/genproto v0.0.0-20220106162220-2482ccee2e38
google.golang.org/grpc v1.43.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
google.golang.org/protobuf v1.27.1
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0
modernc.org/sqlite v1.12.0
k8s.io/klog/v2 v2.40.1 // indirect
modernc.org/ccgo/v3 v3.14.0 // indirect
modernc.org/libc v1.13.2 // indirect
modernc.org/sqlite v1.14.3
nhooyr.io/websocket v1.8.7 // indirect
)

replace github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20210519120135-d95b0972505f
// Prometheus v2.32.1
replace github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20211217191541-41f1a8125e66

replace go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v0.24.0
1,000 changes: 772 additions & 228 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/prometheus/prometheus/discovery"
_ "github.com/prometheus/prometheus/discovery/install" // Imported for registration side-effect
"github.com/prometheus/prometheus/discovery/targetgroup"
"github.com/prometheus/prometheus/pkg/relabel"
"github.com/prometheus/prometheus/model/relabel"
"gopkg.in/yaml.v2"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/debuginfo/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/thanos-io/thanos/pkg/objstore/client"
"github.com/thanos-io/thanos/pkg/objstore/filesystem"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func TestStore(t *testing.T) {
Expand Down Expand Up @@ -78,7 +79,7 @@ func TestStore(t *testing.T) {
}
}()

conn, err := grpc.Dial(lis.Addr().String(), grpc.WithInsecure())
conn, err := grpc.Dial(lis.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
defer conn.Close()
c := NewDebugInfoClient(conn)
Expand Down
2 changes: 1 addition & 1 deletion pkg/metastore/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"time"
"unsafe"

"github.com/cenkalti/backoff"
"github.com/cenkalti/backoff/v4"
"github.com/google/uuid"
pb "github.com/parca-dev/parca/gen/proto/go/parca/metastore/v1alpha1"
"go.opentelemetry.io/otel/attribute"
Expand Down
5 changes: 3 additions & 2 deletions pkg/parca/parca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import (
"testing"
"time"

"github.com/cenkalti/backoff"
"github.com/cenkalti/backoff/v4"
"github.com/go-kit/log"
pb "github.com/parca-dev/parca/gen/proto/go/parca/profilestore/v1alpha1"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func benchmarkSetup(ctx context.Context, b *testing.B) (pb.ProfileStoreServiceClient, <-chan struct{}) {
Expand All @@ -43,7 +44,7 @@ func benchmarkSetup(ctx context.Context, b *testing.B) (pb.ProfileStoreServiceCl
var conn grpc.ClientConnInterface
err := backoff.Retry(func() error {
var err error
conn, err = grpc.Dial(":9090", grpc.WithInsecure())
conn, err = grpc.Dial(":9090", grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/profilestore/profilestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/go-kit/log/level"
"github.com/google/pprof/profile"
"github.com/parca-dev/parca/pkg/metastore"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"go.opentelemetry.io/otel/trace"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
6 changes: 3 additions & 3 deletions pkg/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"github.com/go-kit/log/level"
profilestorepb "github.com/parca-dev/parca/gen/proto/go/parca/profilestore/v1alpha1"
pb "github.com/parca-dev/parca/gen/proto/go/parca/query/v1alpha1"
"github.com/parca-dev/parca/pkg/metastore"
"github.com/parca-dev/parca/pkg/profile"
"github.com/parca-dev/parca/pkg/storage"
"github.com/parca-dev/parca/pkg/metastore"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/pkg/timestamp"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/timestamp"
"github.com/prometheus/prometheus/promql/parser"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
Expand Down
2 changes: 1 addition & 1 deletion pkg/query/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/google/pprof/profile"
"github.com/parca-dev/parca/pkg/metastore"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/trace"
"google.golang.org/grpc/codes"
Expand Down
7 changes: 3 additions & 4 deletions pkg/scrape/scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ import (
"github.com/go-kit/log/level"
profilepb "github.com/parca-dev/parca/gen/proto/go/parca/profilestore/v1alpha1"
"github.com/parca-dev/parca/pkg/config"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
commonconfig "github.com/prometheus/common/config"
"github.com/prometheus/common/version"
"github.com/prometheus/prometheus/discovery/targetgroup"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/pkg/pool"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/util/pool"
"golang.org/x/net/context/ctxhttp"
)

Expand Down Expand Up @@ -329,7 +328,7 @@ func (s *targetScraper) scrape(ctx context.Context, w io.Writer, profileType str
default:
b, err := ioutil.ReadAll(io.TeeReader(resp.Body, w))
if err != nil {
return errors.Wrap(err, "failed to read body")
return fmt.Errorf("failed to read body: %w", err)
}

if len(b) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scrape/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

profilepb "github.com/parca-dev/parca/gen/proto/go/parca/profilestore/v1alpha1"
pb "github.com/parca-dev/parca/gen/proto/go/parca/scrape/v1alpha1"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/timestamppb"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/scrape/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"github.com/parca-dev/parca/pkg/config"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/discovery/targetgroup"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/pkg/relabel"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/relabel"
)

// TargetHealth describes the health state of a target.
Expand Down
3 changes: 2 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"golang.org/x/net/http2/h2c"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
grpc_health "google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/reflection"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -125,7 +126,7 @@ func (s *Server) ListenAndServe(ctx context.Context, logger log.Logger, port str
),
)

opts := []grpc.DialOption{grpc.WithInsecure()}
opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}
mux := runtime.NewServeMux()
for _, r := range registerables {
if err := r.Register(ctx, srv, mux, port, opts); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (

"github.com/go-kit/log"
"github.com/google/pprof/profile"
"github.com/parca-dev/parca/pkg/metastore"
parcaprofile "github.com/parca-dev/parca/pkg/profile"
"github.com/parca-dev/parca/pkg/storage"
"github.com/parca-dev/parca/pkg/metastore"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/trace"
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (

"github.com/parca-dev/parca/pkg/profile"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/pkg/timestamp"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/timestamp"
"go.opentelemetry.io/otel/trace"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
parcaprofile "github.com/parca-dev/parca/pkg/profile"
"github.com/parca-dev/parca/pkg/metastore"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/pkg/timestamp"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/timestamp"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/trace"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/head.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/parca-dev/parca/pkg/storage/chunkenc"
"github.com/parca-dev/parca/pkg/storage/index"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
"go.uber.org/atomic"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/head_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"sort"

"github.com/dgraph-io/sroar"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/head_read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/parca-dev/parca/pkg/profile"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/trace"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/google/uuid"
"github.com/parca-dev/parca/pkg/profile"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/trace"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/index/postings.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"sync"

"github.com/dgraph-io/sroar"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
)

var allPostingsKey = labels.Label{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/index/postings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/dgraph-io/sroar"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/dgraph-io/sroar"
"github.com/parca-dev/parca/pkg/storage/index"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
)

// Bitmap used by func isRegexMetaCharacter to check whether a character needs to be escaped.
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/querier_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"

parcaprofile "github.com/parca-dev/parca/pkg/profile"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/trace"
)
Expand Down
10 changes: 4 additions & 6 deletions pkg/storage/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"testing"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/trace"
"go.uber.org/atomic"
Expand All @@ -35,8 +35,6 @@ func TestPostingsForMatchers(t *testing.T) {

ir := &headIndexReader{head: h}

var empty []uint64

testcases := []struct {
name string
matchers []*labels.Matcher
Expand All @@ -61,7 +59,7 @@ func TestPostingsForMatchers(t *testing.T) {
{Type: labels.MatchEqual, Name: "n", Value: "1"},
{Type: labels.MatchEqual, Name: "i", Value: "missing"},
},
exp: empty,
exp: []uint64{},
}, {
name: `missing=""`,
matchers: []*labels.Matcher{
Expand All @@ -86,7 +84,7 @@ func TestPostingsForMatchers(t *testing.T) {
matchers: []*labels.Matcher{
{Type: labels.MatchNotEqual, Name: "missing", Value: ""},
},
exp: empty,
exp: []uint64{},
}, {
name: `n="1",n!="2"`,
matchers: []*labels.Matcher{
Expand Down Expand Up @@ -189,7 +187,7 @@ func TestPostingsForMatchers(t *testing.T) {
labels.MustNewMatcher(labels.MatchEqual, "n", "1"),
labels.MustNewMatcher(labels.MatchNotRegexp, "i", "^.*$"),
},
exp: empty,
exp: []uint64{},
}, {
name: `n="1",i!~"^.+$"`,
matchers: []*labels.Matcher{
Expand Down
Loading

0 comments on commit 3be8c67

Please sign in to comment.