Skip to content

Commit ecb7b83

Browse files
authored
feat: k6 gRPC middleware (#133)
1 parent 61fc186 commit ecb7b83

19 files changed

+813
-55
lines changed

.github/workflows/check_golang_profiler_changes.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
if: github.repository == 'grafana/pyroscope-go' # avoid running on forks
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
15-
- uses: actions/setup-go@v3
14+
uses: actions/checkout@v4
15+
- uses: actions/setup-go@v5
1616
with:
1717
go-version: '1.20'
1818
- name: Check golang runtime profiler changes

.github/workflows/go.yml

+26-3
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,32 @@ jobs:
1515
go: ['1.18', '1.19', '1.20', '1.21', '1.22', '1.23', 'tip']
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
19+
1920
- name: Install Go ${{ matrix.go }}
2021
if: matrix.go != 'tip'
21-
uses: actions/setup-go@v4
22+
uses: actions/setup-go@v5
2223
with:
2324
go-version: ${{ matrix.go }}
25+
26+
- name: Install dependencies
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y jq
30+
2431
- name: Run go/mod
2532
run: make go/mod && git diff --exit-code
33+
34+
- name: Run k6 go/mod
35+
if: contains('1.22 1.23 tip', matrix.go)
36+
run: cd x/k6 && make go/mod && git diff --exit-code
37+
2638
- name: Install Go stable
2739
if: matrix.go == 'tip'
28-
uses: actions/setup-go@v4
40+
uses: actions/setup-go@v5
2941
with:
3042
go-version: 1.x
43+
3144
- name: Install Go tip
3245
shell: bash
3346
if: matrix.go == 'tip'
@@ -39,10 +52,20 @@ jobs:
3952
echo "$HOME/go/bin" >> "$GITHUB_PATH"
4053
echo "$HOME/sdk/gotip/bin" >> "$GITHUB_PATH"
4154
make gotip/fix
55+
4256
- name: Build example application
4357
run: go build example/main.go
58+
4459
- name: Run tests
4560
run: |
4661
which go
4762
go version
4863
make test
64+
65+
- name: Run k6 tests
66+
if: contains('1.22 1.23 tip', matrix.go)
67+
run: |
68+
which go
69+
go version
70+
cd x/k6
71+
make test

.github/workflows/gotip_cron_test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
- name: Install Go stable
15-
uses: actions/setup-go@v4
15+
uses: actions/setup-go@v5
1616
with:
1717
go-version: 1.x
1818
- name: Install Go tip

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea/
2+
.vscode/
23

3-
main
4+
main

Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GO_VERSION_PRE20 := $(shell go version | awk '{print $$3}' | awk -F '.' '{print ($$1 == "go1" && int($$2) < 20)}')
2-
TEST_PACKAGES := ./... ./godeltaprof/compat/... ./godeltaprof/... ./x/k6/...
2+
TEST_PACKAGES := ./... ./godeltaprof/compat/... ./godeltaprof/...
33

44
.PHONY: test
55
test:
@@ -14,8 +14,6 @@ go/mod:
1414
cd godeltaprof/compat/ && GO111MODULE=on go mod tidy
1515
cd godeltaprof/ && GO111MODULE=on go mod download
1616
cd godeltaprof/ && GO111MODULE=on go mod tidy
17-
cd x/k6/ && GO111MODULE=on go mod download
18-
cd x/k6/ && GO111MODULE=on go mod tidy
1917

2018
# https://github.com/grafana/pyroscope-go/issues/129
2119
.PHONY: gotip/fix

go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ require (
1212
require (
1313
github.com/davecgh/go-spew v1.1.1 // indirect
1414
github.com/klauspost/compress v1.17.8 // indirect
15+
github.com/kr/pretty v0.3.1 // indirect
1516
github.com/pmezard/go-difflib v1.0.0 // indirect
1617
github.com/stretchr/objx v0.5.2 // indirect
18+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
1719
gopkg.in/yaml.v3 v3.0.1 // indirect
1820
)

go.sum

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
12
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
23
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
34
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
45
github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
56
github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
7+
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
8+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
9+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
10+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
11+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
12+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
13+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
14+
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
615
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
716
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
17+
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
18+
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
819
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
920
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
1021
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -15,8 +26,9 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
1526
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
1627
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
1728
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
18-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1929
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
30+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
31+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
2032
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2133
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
2234
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

go.work

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
go 1.19
1+
go 1.18
22

33
use (
44
.
55
godeltaprof
66
godeltaprof/compat
7-
x/k6
87
)

0 commit comments

Comments
 (0)