grafana / xk6-output-prometheus-remote

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

fix: bump k6 to last version #156

Closed hugoblanc closed 1 year ago

hugoblanc commented 1 year ago

Not able to build anymore in version 0.30.0 or 0.30.1 with k6 v0.46.1 since 1. or 2 weeks

#9 17.63 go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
#9 17.66 go: found gopkg.in/tomb.v1 in gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
#9 17.73 k6 imports
#9 17.73        github.com/grafana/xk6-browser imports
#9 17.73        go.k6.io/k6/js/modules imports
#9 17.73        go.k6.io/k6/loader tested by
#9 17.73        go.k6.io/k6/loader.test imports
#9 17.73        go.k6.io/k6/lib/testutils/httpmultibin imports
#9 17.73        google.golang.org/grpc/status imports
#9 17.73        google.golang.org/genproto/googleapis/rpc/status: ambiguous import: found package google.golang.org/genproto/googleapis/rpc/status in multiple modules:
#9 17.73        google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/go/pkg/mod/google.golang.org/genproto@v0.0.0-20230410155749-daa745c078e1/googleapis/rpc/status)
#9 17.73        google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 (/go/pkg/mod/google.golang.org/genproto/googleapis/rpc@v0.0.0-20230525234030-28d5490b6b19/status)
#9 17.75 2023/10/19 08:35:51 [INFO] Cleaning up temporary folder: /tmp/buildenv_2023-10-19-0835.1585164348
#9 17.75 2023/10/19 08:35:51 [FATAL] exit status 1
------
executor failed running [/bin/sh -c xk6 build --output "/tmp/k6" --with github.com/grafana/xk6-output-prometheus-remote@v0.3.1 --with github.com/grafana/xk6-browser]: exit code: 1
CLAassistant commented 1 year ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Hugo Blanc seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

hugoblanc commented 1 year ago
image
codebien commented 1 year ago

Hey @hugoblanc,

How are you running the build? Are you running the following command?

xk6 build v0.46.1 github.com/grafana/xk6-output-prometheus-remote@v0.3.1

Is there any specific reason for using v0.46.1? If you force the build using v0.47.0 does it work with v0.3.1? You can do it with the following command:

xk6 build v0.47.0 github.com/grafana/xk6-output-prometheus-remote@v0.3.1

In any case, I pushed the update of the k6 package to the main branch, you can try it:

xk6 build --with github.com/grafana/xk6-output-prometheus-remote@main
hugoblanc commented 1 year ago

Sorry for the missing details. After some test it looks like the error is related to using xk6-output-prometheus-remote version > 0.3.0 in combinaison with github.com/grafana/xk6-browser

Here a Dockerfile to reproduce =>

FROM grafana/xk6:0.9.2 as builder

WORKDIR /build

RUN xk6 build --output "/tmp/k6" --with github.com/grafana/xk6-output-prometheus-remote@v0.3.1 --with github.com/grafana/xk6-browser

Sadly it looks like go.k6.io/k6 v0.47.0 do not solve the issue because I still face the problem on main github.com/grafana/xk6-output-prometheus-remote@main

The following docker image is working perfectly fine

FROM grafana/xk6:0.9.2 as builder

WORKDIR /build

RUN xk6 build --output "/tmp/k6" --with github.com/grafana/xk6-output-prometheus-remote@v0.2.3 --with github.com/grafana/xk6-browser
codebien commented 1 year ago

@hugoblanc I see, we may have some conflict across the extensions, I will investigate more about it.

I don't know if you are aware of it, but the browser is already included in the k6 binary as an experimental module, so I suggest using it if you don't have a strict requirement of it as an extension.

codebien commented 1 year ago

Hi @hugoblanc, I checked the build and I confirm that building the browser+prometheus using the @latest version is not possible.

However, as mentioned in the previous comment, they are both already available as built-in components of the k6 binary so I don't think we should release a dedicated tag for fixing this issue.

In any case, if you still have a reason for building a binary with the extensions then you can use the main branch of the xk6-browser that fixes the issue:

xk6 build v0.47.0 --with github.com/grafana/xk6-output-prometheus-remote@latest --with github.com/grafana/xk6-browser@main

I'm closing this PR, feel free to re-open it or add more comments. Thanks again for the contribution.