uptrace / opentelemetry-go-extra

OpenTelemetry instrumentations for Go
https://uptrace.dev/get/instrument/
BSD 2-Clause "Simplified" License
314 stars 72 forks source link

Release v1.15.0/v0.38.0 breaks otelsql #101

Closed reenjii closed 1 year ago

reenjii commented 1 year ago

Latest opentelemetry-go release v1.15.0/v0.38.0 breaks otelsql. https://github.com/open-telemetry/opentelemetry-go/pull/4035

github.com/uptrace/opentelemetry-go-extra/otelsql/otel.go:109:70: cannot use t.attrs (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as type []metric.RecordOption in argument to t.queryHistogram.Record github.com/uptrace/opentelemetry-go-extra/otelsql/otel.go:228:66: cannot use labels (variable of type []"go.opentelemetry.io/otel/attribute".KeyValue) as type []metric.ObserveOption in argument to o.ObserveInt64

A breaking change has been introduced in: https://github.com/open-telemetry/opentelemetry-go/pull/3971

The measurement methods for all instruments in go.opentelemetry.io/otel/metric/instrument accept an option instead of the variadic "go.opentelemetry.io/otel/attribute".KeyValue

We need to use new metric.WithAttributes helper to build an ObserveOption list from a KeyValue list.

vmihailenco commented 1 year ago

Thanks :+1: