Skip to content

Commit 616e81a

Browse files
authored
Use custom codec for vtproto within connect-go (#3310)
This implements a custom coded within connect-go.
1 parent b79c573 commit 616e81a

File tree

24 files changed

+205
-42
lines changed

24 files changed

+205
-42
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ $(BIN)/protoc-gen-go: Makefile go.mod
268268

269269
$(BIN)/protoc-gen-connect-go: Makefile go.mod
270270
@mkdir -p $(@D)
271-
GOBIN=$(abspath $(@D)) $(GO) install connectrpc.com/connect/cmd/protoc-gen-connect-go@v1.14.0
271+
GOBIN=$(abspath $(@D)) $(GO) install connectrpc.com/connect/cmd/protoc-gen-connect-go@v1.16.2
272272

273273
$(BIN)/protoc-gen-connect-go-mux: Makefile go.mod
274274
@mkdir -p $(@D)

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/grafana/pyroscope/api
33
go 1.21
44

55
require (
6-
connectrpc.com/connect v1.14.0
6+
connectrpc.com/connect v1.16.2
77
github.com/gorilla/mux v1.8.0
88
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0
99
github.com/planetscale/vtprotobuf v0.6.0

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
connectrpc.com/connect v1.14.0 h1:PDS+J7uoz5Oui2VEOMcfz6Qft7opQM9hPiKvtGC01pA=
2-
connectrpc.com/connect v1.14.0/go.mod h1:uoAq5bmhhn43TwhaKdGKN/bZcGtzPW1v+ngDTn5u+8s=
1+
connectrpc.com/connect v1.16.2 h1:ybd6y+ls7GOlb7Bh5C8+ghA6SvCBajHwxssO2CGFjqE=
2+
connectrpc.com/connect v1.16.2/go.mod h1:n2kgwskMHXC+lVqb18wngEpF95ldBHXjZYJussz5FRc=
33
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
44
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
55
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=

cmd/profilecli/query.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/grafana/pyroscope/api/gen/proto/go/querier/v1/querierv1connect"
2121
"github.com/grafana/pyroscope/api/gen/proto/go/storegateway/v1/storegatewayv1connect"
2222
typesv1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1"
23+
connectapi "github.com/grafana/pyroscope/pkg/api/connect"
2324
"github.com/grafana/pyroscope/pkg/operations"
2425
"github.com/k0kubun/pp/v3"
2526
"github.com/klauspost/compress/gzip"
@@ -37,20 +38,23 @@ func (c *phlareClient) queryClient() querierv1connect.QuerierServiceClient {
3738
return querierv1connect.NewQuerierServiceClient(
3839
c.httpClient(),
3940
c.URL,
41+
connectapi.DefaultClientOptions()...,
4042
)
4143
}
4244

4345
func (c *phlareClient) storeGatewayClient() storegatewayv1connect.StoreGatewayServiceClient {
4446
return storegatewayv1connect.NewStoreGatewayServiceClient(
4547
c.httpClient(),
4648
c.URL,
49+
connectapi.DefaultClientOptions()...,
4750
)
4851
}
4952

5053
func (c *phlareClient) ingesterClient() ingesterv1connect.IngesterServiceClient {
5154
return ingesterv1connect.NewIngesterServiceClient(
5255
c.httpClient(),
5356
c.URL,
57+
connectapi.DefaultClientOptions()...,
5458
)
5559
}
5660

cmd/profilecli/upload.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
pushv1 "github.com/grafana/pyroscope/api/gen/proto/go/push/v1"
1313
"github.com/grafana/pyroscope/api/gen/proto/go/push/v1/pushv1connect"
14+
connectapi "github.com/grafana/pyroscope/pkg/api/connect"
1415
"github.com/grafana/pyroscope/pkg/model"
1516
"github.com/grafana/pyroscope/pkg/pprof"
1617
)
@@ -19,6 +20,7 @@ func (c *phlareClient) pusherClient() pushv1connect.PusherServiceClient {
1920
return pushv1connect.NewPusherServiceClient(
2021
c.httpClient(),
2122
c.URL,
23+
connectapi.DefaultClientOptions()...,
2224
)
2325
}
2426

ebpf/cmd/playground/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,30 @@ import (
88
"encoding/json"
99
"flag"
1010
"fmt"
11-
"github.com/prometheus/client_golang/prometheus"
1211
"os"
1312
"strconv"
1413
"strings"
1514
"time"
1615

1716
"connectrpc.com/connect"
1817
"github.com/go-kit/log"
18+
"github.com/go-kit/log/level"
1919
"github.com/grafana/pyroscope/ebpf/cpp/demangle"
2020
ebpfmetrics "github.com/grafana/pyroscope/ebpf/metrics"
2121
"github.com/pkg/errors"
22+
"github.com/prometheus/client_golang/prometheus"
23+
commonconfig "github.com/prometheus/common/config"
2224
"github.com/prometheus/common/model"
2325
"github.com/prometheus/prometheus/model/labels"
2426
"github.com/prometheus/prometheus/model/relabel"
2527

26-
"github.com/go-kit/log/level"
2728
pushv1 "github.com/grafana/pyroscope/api/gen/proto/go/push/v1"
2829
"github.com/grafana/pyroscope/api/gen/proto/go/push/v1/pushv1connect"
2930
typesv1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1"
3031
ebpfspy "github.com/grafana/pyroscope/ebpf"
3132
"github.com/grafana/pyroscope/ebpf/pprof"
3233
"github.com/grafana/pyroscope/ebpf/sd"
3334
"github.com/grafana/pyroscope/ebpf/symtab"
34-
commonconfig "github.com/prometheus/common/config"
3535
)
3636

3737
var configFile = flag.String("config", "", "config file path")

ebpf/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/grafana/pyroscope/ebpf
33
go 1.21
44

55
require (
6-
connectrpc.com/connect v1.14.0
6+
connectrpc.com/connect v1.16.2
77
github.com/avvmoto/buf-readerat v0.0.0-20171115124131-a17c8cb89270
88
github.com/cespare/xxhash/v2 v2.2.0
99
github.com/cilium/ebpf v0.11.0

ebpf/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
connectrpc.com/connect v1.14.0 h1:PDS+J7uoz5Oui2VEOMcfz6Qft7opQM9hPiKvtGC01pA=
2-
connectrpc.com/connect v1.14.0/go.mod h1:uoAq5bmhhn43TwhaKdGKN/bZcGtzPW1v+ngDTn5u+8s=
1+
connectrpc.com/connect v1.16.2 h1:ybd6y+ls7GOlb7Bh5C8+ghA6SvCBajHwxssO2CGFjqE=
2+
connectrpc.com/connect v1.16.2/go.mod h1:n2kgwskMHXC+lVqb18wngEpF95ldBHXjZYJussz5FRc=
33
github.com/avvmoto/buf-readerat v0.0.0-20171115124131-a17c8cb89270 h1:JIxGEMs4E5Zb6R7z2C5IgecI0mkqS97WAEF31wUbYTM=
44
github.com/avvmoto/buf-readerat v0.0.0-20171115124131-a17c8cb89270/go.mod h1:2XtVRGCw/HthOLxU0Qw6o6jSJrcEoOb2OCCl8gQYvGw=
55
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/grafana/pyroscope
33
go 1.21
44

55
require (
6-
connectrpc.com/connect v1.14.0
6+
connectrpc.com/connect v1.16.2
77
connectrpc.com/grpchealth v1.3.0
88
github.com/PuerkitoBio/goquery v1.8.1
99
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
4040
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
4141
cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8=
4242
cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8=
43-
connectrpc.com/connect v1.14.0 h1:PDS+J7uoz5Oui2VEOMcfz6Qft7opQM9hPiKvtGC01pA=
44-
connectrpc.com/connect v1.14.0/go.mod h1:uoAq5bmhhn43TwhaKdGKN/bZcGtzPW1v+ngDTn5u+8s=
43+
connectrpc.com/connect v1.16.2 h1:ybd6y+ls7GOlb7Bh5C8+ghA6SvCBajHwxssO2CGFjqE=
44+
connectrpc.com/connect v1.16.2/go.mod h1:n2kgwskMHXC+lVqb18wngEpF95ldBHXjZYJussz5FRc=
4545
connectrpc.com/grpchealth v1.3.0 h1:FA3OIwAvuMokQIXQrY5LbIy8IenftksTP/lG4PbYN+E=
4646
connectrpc.com/grpchealth v1.3.0/go.mod h1:3vpqmX25/ir0gVgW6RdnCPPZRcR6HvqtXX5RNPmDXHM=
4747
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=

0 commit comments

Comments
 (0)