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

Updates required to compile with "go.opentelemetry.io/otel/metric" version 0.38.0 #162

Closed
seh opened this issue Apr 28, 2023 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@seh
Copy link

seh commented Apr 28, 2023

Description

Updating the "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" Go module to version 0.41.0 (per today's release of that repository's version 1.16.0) drags the "go.opentelemetry.io/otel/metric" Go module up to version 0.38.0, with which this module no longer compiles.

Attempting to use this module produces the following compilation errors:

sql.go:141:3: cannot use cfg.Attributes (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.ObserveOption value in argument to observer.ObserveInt64
sql.go:146:3: cannot use append(cfg.Attributes, connectionStatusKey.String("inuse")) (value of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.ObserveOption value in argument to observer.ObserveInt64
sql.go:150:3: cannot use append(cfg.Attributes, connectionStatusKey.String("idle")) (value of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.ObserveOption value in argument to observer.ObserveInt64
sql.go:155:3: cannot use cfg.Attributes (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.ObserveOption value in argument to observer.ObserveInt64
sql.go:159:3: cannot use cfg.Attributes (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.ObserveOption value in argument to observer.ObserveFloat64
sql.go:163:3: cannot use cfg.Attributes (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.ObserveOption value in argument to observer.ObserveInt64
sql.go:167:3: cannot use cfg.Attributes (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.ObserveOption value in argument to observer.ObserveInt64
sql.go:171:3: cannot use cfg.Attributes (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.ObserveOption value in argument to observer.ObserveInt64
utils.go:73:4: cannot use attributes (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as []metric.RecordOption value in argument to instruments.latency.Record

Environment

  • OS: macOS
  • Architecture: x86
  • Go Version: 1.20.3
  • otelsql version: v0.21.0

Steps To Reproduce

  1. Include the following entries in a go.mod file, at minimum:
require (
	github.com/XSAM/otelsql v0.21.0
	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.41.0
	go.opentelemetry.io/otel v1.15.0
	go.opentelemetry.io/otel/trace v1.15.0
)
  1. Write a Go program that uses this "github.com/XSAM/otelsql" module.
  2. Observe that compilation fails as described above.

Expected behavior

The program would compile as it did before upgrading the "go.opentelemetry.io/otel/metric" Go module (indirectly) to version 0.38.0. See open-telemetry/opentelemetry-go#3971 by @MrAlias for the recent change to generalize the final variadic parameters to the methods involved here.

@seh seh added the bug Something isn't working label Apr 28, 2023
@XSAM XSAM self-assigned this Apr 29, 2023
@XSAM
Copy link
Owner

XSAM commented Apr 29, 2023

I made a new release https://github.com/XSAM/otelsql/releases/tag/v0.22.0. I hope this could fix the issue.

@seh
Copy link
Author

seh commented Apr 30, 2023

I hope this could fix the issue.

Indeed it does! Thank you for the fast response. All is well.

@seh seh closed this as completed Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants