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

OpenTelemetry error installing K6 v0.53.0 #3897

Open
IDispose opened this issue Aug 14, 2024 · 6 comments
Open

OpenTelemetry error installing K6 v0.53.0 #3897

IDispose opened this issue Aug 14, 2024 · 6 comments
Assignees

Comments

@IDispose
Copy link

Brief summary

running go install go.k6.io/k6 spits out this error

# go.opentelemetry.io/otel/sdk/metric
/Users/me/go/pkg/mod/go.opentelemetry.io/otel/sdk/[email protected]/meter.go:76:22: cannot use (*meter)(nil) (value of type *meter) as "go.opentelemetry.io/otel/metric".Meter value in variable declaration: *meter does not implement "go.opentelemetry.io/otel/metric".Meter (missing method Float64Gauge)
/Users/me/go/pkg/mod/go.opentelemetry.io/otel/sdk/[email protected]/provider.go:101:9: cannot use mp.meters.Lookup(s, func() *meter {…}) (value of type *meter) as "go.opentelemetry.io/otel/metric".Meter value in return statement: *meter does not implement "go.opentelemetry.io/otel/metric".Meter (missing method Float64Gauge)

k6 version

v0.53.0

OS

macOS Sonoma 14.5

Docker version and image (if applicable)

No response

Steps to reproduce the problem

running go install go.k6.io/k6

Expected behaviour

K6 should be installed without errors

Actual behaviour

# go.opentelemetry.io/otel/sdk/metric
/Users/me/go/pkg/mod/go.opentelemetry.io/otel/sdk/[email protected]/meter.go:76:22: cannot use (*meter)(nil) (value of type *meter) as "go.opentelemetry.io/otel/metric".Meter value in variable declaration: *meter does not implement "go.opentelemetry.io/otel/metric".Meter (missing method Float64Gauge)
/Users/me/go/pkg/mod/go.opentelemetry.io/otel/sdk/[email protected]/provider.go:101:9: cannot use mp.meters.Lookup(s, func() *meter {…}) (value of type *meter) as "go.opentelemetry.io/otel/metric".Meter value in return statement: *meter does not implement "go.opentelemetry.io/otel/metric".Meter (missing method Float64Gauge)
@olegbespalov
Copy link
Contributor

Hey @IDispose

Thanks for reporting this!

Unfortunately, I can't reproduce it on my (linux) side. If I run both go install -v go.k6.io/[email protected] or go install -v go.k6.io/k6 it works as expected.

image

My colleague also double-checked that it works on Mac OS.

There is a similar report grafana/xk6-output-opentelemetry#21, which was likely caused by a different version of the OTEL libraries pinned in the custom extension.

Could you please confirm that you're using trying to install a stock version of k6, not through the xk6.

Also, out of curiosity, how will result in the installation with the explicit versions, like: go install go.k6.io/[email protected] or go install -v go.k6.io/[email protected]?

Thanks!

@IDispose
Copy link
Author

@olegbespalov go install go.k6.io/[email protected] works without any errors.

@olegbespalov
Copy link
Contributor

Closing for now; if something else or more details will appear, let's re-open.

@olegbespalov olegbespalov closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2024
@olegbespalov olegbespalov removed their assignment Aug 21, 2024
@mostafa
Copy link
Member

mostafa commented Sep 11, 2024

When building xk6 modules like xk6-kafka with k6 v0.53.0, the go.opentelemetry.io/otel/sdk/[email protected] appears out of the blue in the list of packages. I pinned the v1.28.0 for now, until this issue is resolved. Also, this is the output of go mod graph before pinning the package in this PR:

go.k6.io/[email protected] go.opentelemetry.io/otel/sdk/[email protected]

BTW, this is resolved by pinning the package.

@olegbespalov
Copy link
Contributor

hey @mostafa

I'm not quite sure if I got which issue you're referring to 🤷

That's correct that k6 v0.53 brings a few more opentelemetry libraries, and if extensions need an updated version of them that might not work. In the upcoming version of the k6 (the latest master branch), we also updated the libraries as part of grafana/xk6-output-opentelemetry#22.

Could you please maybe provide the steps to reproduce the issue? Thanks!

@mostafa
Copy link
Member

mostafa commented Sep 12, 2024

Hey @olegbespalov,

Here are the steps:

  1. Install the latest version of xk6.
  2. Clone xk6-kafka.
  3. Reset to an older commit (not updated to k6 v0.53.0).
  4. Get the latest k6.
  5. Try to build it.
go install go.k6.io/xk6/cmd/xk6@latest
git clone [email protected]:mostafa/xk6-kafka.git && cd xk6-kafka
git reset --hard 9cbd5bd553d1a1e41064ccb0fc4daf0c0a626b88 # HEAD is now at 9cbd5bd Add FAQ No. 13
go get go.k6.io/[email protected]
go mod tidy
go mod graph | grep go.opentelemetry.io/otel/sdk/metric # go.k6.io/[email protected] go.opentelemetry.io/otel/sdk/[email protected]
xk6 build --with github.com/mostafa/xk6-kafka@latest=. # sometimes it builds, sometimes it nags about go.opentelemetry.io/otel/sdk/[email protected]

I struggled with this yesterday, but it didn't happen today. 🤷 Maybe let's close this.

raven-txm added a commit to sportsball-ai/xk6-srt that referenced this issue Sep 13, 2024
Metrics were being refactored around the era of k6 0.40.0, and with 0.41
a breaking change was made that requires code updates to use.

This change updates the code in order to work with 0.41 and newer
versions of k6, at the cost of breaking compatability with 0.40 and
older versions of k6.

Since the current version of k6 is 0.53.0 at the time of writing, we
don't feel like this is too onerous.

Note:
- Open Telemetry is pinned to 0.24 instead of 0.28 / 0.30 used in k6
  0.53 due to build issues. See
  grafana/k6#3897
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

4 participants