grafana / xk6-output-prometheus-remote

k6 extension to output real-time test metrics using Prometheus Remote Write.
GNU Affero General Public License v3.0
156 stars 72 forks source link

Unable build prometheus-remote extension with xk6 #56

Closed Srinirap closed 1 year ago

Srinirap commented 1 year ago

go version go1.19.1

2022/11/09 20:35:04 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
2022/11/09 20:35:05 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/local/bin/k6 -ldflags -w -s -trimpath
# github.com/grafana/xk6-output-prometheus-remote/pkg/remotewrite
../../../go/pkg/mod/github.com/grafana/xk6-output-prometheus-remote@v0.0.4/pkg/remotewrite/remotewrite.go:286:18: undefined: metrics.SampleTags
../../../go/pkg/mod/github.com/grafana/xk6-output-prometheus-remote@v0.0.4/pkg/remotewrite/remotewrite.go:291:59: undefined: metrics.SampleTags
../../../go/pkg/mod/github.com/grafana/xk6-output-prometheus-remote@v0.0.4/pkg/remotewrite/prometheus.go:12:27: undefined: metrics.SampleTags
2022/11/09 20:36:17 [INFO] Cleaning up temporary folder: /Users/srinivasan/mywork/k6build/buildenv_2022-11-09-2032.682437367
2022/11/09 20:36:17 [FATAL] exit status 2

https://github.com/grafana/xk6-output-prometheus-remote/issues/56#tasklist-block-126fe2cb-28b5-419d-9932-b1bc01f6211b

codebien commented 1 year ago

I think you're facing https://github.com/grafana/xk6/issues/52 issue

Can you try explicating the v0.41.0, please?

xk6 build v0.41.0 --with github.com/grafana/xk6-output-prometheus-remote
Srinirap commented 1 year ago

@codebien Still getting the same error,

xk6 build v0.41.0 --with github.com/grafana/xk6-output-prometheus-remote
2022/11/10 01:26:10 [INFO] Temporary folder: /Users/srinivasan/workspace/dcms-loadtest-scripts/buildenv_2022-11-10-0126.102888145
2022/11/10 01:26:10 [INFO] Initializing Go module
2022/11/10 01:26:10 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init k6
go: creating new go.mod: module k6
2022/11/10 01:26:11 [INFO] Pinning versions
2022/11/10 01:26:11 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod edit -require github.com/grafana/xk6-output-prometheus-remote@latest
2022/11/10 01:26:11 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
2022/11/10 01:26:12 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
2022/11/10 01:26:12 [INFO] Writing main module: /Users/srinivasan/workspace/dcms-loadtest-scripts/buildenv_2022-11-10-0126.102888145/main.go
2022/11/10 01:26:12 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod edit -require go.k6.io/k6@v0.41.0
2022/11/10 01:26:12 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
go: downloading golang.org/x/term v0.0.0-20220919170432-7a66f970e087
go: downloading github.com/mstoykov/atlas v0.0.0-20220808085829-90340e9998bd
go: downloading github.com/dop251/goja v0.0.0-20221003171542-5ea1285e6c91
go: downloading github.com/klauspost/compress v1.15.11
go: downloading golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be
go: downloading golang.org/x/time v0.0.0-20220922220347-f3bd1da661af
go: downloading golang.org/x/net v0.0.0-20221002022538-bcab6841153b
go: downloading golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec
2022/11/10 01:26:23 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
2022/11/10 01:26:24 [INFO] Build environment ready
2022/11/10 01:26:24 [INFO] Building k6
2022/11/10 01:26:24 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
2022/11/10 01:26:24 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /Users/srinivasan/workspace/dcms-loadtest-scripts/k6 -ldflags -w -s -trimpath
# github.com/grafana/xk6-output-prometheus-remote/pkg/remotewrite
../../../go/pkg/mod/github.com/grafana/xk6-output-prometheus-remote@v0.0.4/pkg/remotewrite/remotewrite.go:286:18: undefined: metrics.SampleTags
../../../go/pkg/mod/github.com/grafana/xk6-output-prometheus-remote@v0.0.4/pkg/remotewrite/remotewrite.go:291:59: undefined: metrics.SampleTags
../../../go/pkg/mod/github.com/grafana/xk6-output-prometheus-remote@v0.0.4/pkg/remotewrite/prometheus.go:12:27: undefined: metrics.SampleTags
2022/11/10 01:26:40 [INFO] Cleaning up temporary folder: /Users/srinivasan/workspace/dcms-loadtest-scripts/buildenv_2022-11-10-0126.102888145
2022/11/10 01:26:40 [FATAL] exit status 2
codebien commented 1 year ago

Hi @Srinirap, my mistake, the version you have to use is v0.40.0 so the following is the correct command:

xk6 build v0.40.0 --with github.com/grafana/xk6-output-prometheus-remote

In the next hours, I'm going to release a working version with the new v0.41.0

RetardedRedhaired commented 1 year ago

Thanks @codebien! I faced the same issue and building with v0.40.0 worked!

codebien commented 1 year ago

Just released a new version for k6 v0.41.0, let us know if something is not working as expected.

Srinirap commented 1 year ago

@codebien v0.41.0 is working for me, Thank you so much 🙂.