Skip to content
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

Unable build prometheus-remote extension with xk6 #56

Closed
Srinirap opened this issue Nov 9, 2022 · 6 comments
Closed

Unable build prometheus-remote extension with xk6 #56

Srinirap opened this issue Nov 9, 2022 · 6 comments

Comments

@Srinirap
Copy link

Srinirap commented Nov 9, 2022

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/[email protected]/pkg/remotewrite/remotewrite.go:286:18: undefined: metrics.SampleTags
../../../go/pkg/mod/github.com/grafana/[email protected]/pkg/remotewrite/remotewrite.go:291:59: undefined: metrics.SampleTags
../../../go/pkg/mod/github.com/grafana/[email protected]/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

#56 (comment)

@codebien
Copy link
Contributor

codebien commented Nov 9, 2022

I think you're facing grafana/xk6#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
Copy link
Author

Srinirap commented Nov 9, 2022

@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/[email protected]
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/[email protected]/pkg/remotewrite/remotewrite.go:286:18: undefined: metrics.SampleTags
../../../go/pkg/mod/github.com/grafana/[email protected]/pkg/remotewrite/remotewrite.go:291:59: undefined: metrics.SampleTags
../../../go/pkg/mod/github.com/grafana/[email protected]/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
Copy link
Contributor

codebien commented Nov 10, 2022

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
Copy link

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

@codebien
Copy link
Contributor

codebien commented Nov 10, 2022

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

@Srinirap
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants