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

otelmetric v2.7.x version declaration relies on an incorrect golang version #3917

Open
muddydog opened this issue Nov 13, 2024 · 0 comments
Open
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@muddydog
Copy link
Contributor

Go version

go version go1.19.3 darwin/arm64

GoFrame version

2.7.4

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

想使用GF的指标监控功能,然后根据自己的golang版本(1.19),选择升级到了 GF v2.7.4 版本,并拉取了 contrib 中对应版本的 otelmetric 包。
go get github.com/gogf/gf/contrib/metric/otelmetric/[email protected]

编译项目时直接报错:

# github.com/prometheus/common/model
../../go/pkg/mod/github.com/prometheus/[email protected]/model/metric.go:363:33: undefined: strings.CutPrefix
note: module requires Go 1.20

确认了一下 https://github.com/gogf/gf/blob/v2.7.4/contrib/metric/otelmetric/go.mod 中声明依赖的go版本为 1.18。

module github.com/gogf/gf/contrib/metric/otelmetric/v2

go 1.18

require (
	github.com/gogf/gf/v2 v2.7.4
	github.com/prometheus/client_golang v1.19.0
	go.opentelemetry.io/contrib/instrumentation/runtime v0.49.0
	go.opentelemetry.io/otel v1.24.0
	go.opentelemetry.io/otel/exporters/prometheus v0.46.0
	go.opentelemetry.io/otel/metric v1.24.0
	go.opentelemetry.io/otel/sdk v1.24.0
	go.opentelemetry.io/otel/sdk/metric v1.24.0
)

明显是错误的,应该是 1.20。这样的话 v2.7.x 版本的 otelmetric 就不可用了。

What did you see happen?

如上

What did you expect to see?

解决的思路:

  1. 【保持依赖的Go版本为1.18】把 go.opentelemetry.io/otel 降到 v1.14.0 版本,把 go.opentelemetry.io/otel/exporters/prometheus 降到 v0.37.0 版本。
  2. 更正GF v2.7.x版本依赖的go版本为 >= 1.20
@muddydog muddydog added the bug It is confirmed a bug, but don't worry, we'll handle it. label Nov 13, 2024
@Issues-translate-bot Issues-translate-bot changed the title otelmetric v2.7.x 版本声明依赖的golang版本不正确 otelmetric v2.7.x version declaration relies on an incorrect golang version Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
Development

No branches or pull requests

1 participant