Skip to content

Commit

Permalink
Upgrade all semconv dependencies to v1.16.0 (#3581)
Browse files Browse the repository at this point in the history
* Upgrade all semconv ref to v1.16.0

* Add changes to changelog
  • Loading branch information
MrAlias authored Jan 10, 2023
1 parent 479c5c5 commit 78a5582
Show file tree
Hide file tree
Showing 31 changed files with 66 additions and 65 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Update the `RegisterCallback` method of the `Meter` in the `go.opentelemetry.io/otel/sdk/metric` package to accept the added `Callback` type instead of an inline function type definition.
The underlying type of a `Callback` is the same `func(context.Context)` that the method used to accept. (#3564)
- The callback function registered with a `Meter` from the `go.opentelemetry.io/otel/metric` package is required to return an error now. (#3576)
- The exporter from `go.opentelemetry.io/otel/exporters/zipkin` is updated to use the `v1.16.0` version of semantic conventions.
This means it no longer uses the removed `net.peer.ip` or `http.host` attributes to determine the remote endpoint.
Instead it uses the `net.sock.peer` attributes. (#3581)

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion bridge/opentracing/internal/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/bridge/opentracing/migration"
"go.opentelemetry.io/otel/codes"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
2 changes: 1 addition & 1 deletion example/fib/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"go.opentelemetry.io/otel/exporters/stdout/stdouttrace"
"go.opentelemetry.io/otel/sdk/resource"
"go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

// newExporter returns a console exporter.
Expand Down
2 changes: 1 addition & 1 deletion example/jaeger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"go.opentelemetry.io/otel/exporters/jaeger"
"go.opentelemetry.io/otel/sdk/resource"
tracesdk "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion example/otel-collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
2 changes: 1 addition & 1 deletion example/zipkin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"go.opentelemetry.io/otel/exporters/zipkin"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
2 changes: 1 addition & 1 deletion exporters/jaeger/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
gen "go.opentelemetry.io/otel/exporters/jaeger/internal/gen-go/jaeger"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
2 changes: 1 addition & 1 deletion exporters/jaeger/jaeger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/sdk/trace/tracetest"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlpmetric/internal/otest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal"
"go.opentelemetry.io/otel/metric/unit"
semconv "go.opentelemetry.io/otel/semconv/v1.10.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
collpb "go.opentelemetry.io/proto/otlp/collector/metrics/v1"
cpb "go.opentelemetry.io/proto/otlp/common/v1"
mpb "go.opentelemetry.io/proto/otlp/metrics/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"go.opentelemetry.io/otel/sdk/instrumentation"
"go.opentelemetry.io/otel/sdk/metric/metricdata"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.10.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
cpb "go.opentelemetry.io/proto/otlp/common/v1"
mpb "go.opentelemetry.io/proto/otlp/metrics/v1"
rpb "go.opentelemetry.io/proto/otlp/resource/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"go.opentelemetry.io/otel/sdk/resource"
tracesdk "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/sdk/trace/tracetest"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
)
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/otlptrace/otlptracehttp/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
2 changes: 1 addition & 1 deletion exporters/prometheus/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/aggregation"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

func TestPrometheusExporter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion exporters/stdout/stdoutmetric/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/metricdata"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.10.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion exporters/stdout/stdouttrace/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"go.opentelemetry.io/otel/exporters/stdout/stdouttrace"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
20 changes: 10 additions & 10 deletions exporters/zipkin/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/sdk/resource"
tracesdk "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down Expand Up @@ -238,13 +238,13 @@ func toZipkinTags(data tracesdk.ReadOnlySpan) map[string]string {
// Rank determines selection order for remote endpoint. See the specification
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.0.1/specification/trace/sdk_exporters/zipkin.md#otlp---zipkin
var remoteEndpointKeyRank = map[attribute.Key]int{
semconv.PeerServiceKey: 0,
semconv.NetPeerNameKey: 1,
semconv.NetPeerIPKey: 2,
keyPeerHostname: 3,
keyPeerAddress: 4,
semconv.HTTPHostKey: 5,
semconv.DBNameKey: 6,
semconv.PeerServiceKey: 0,
semconv.NetPeerNameKey: 1,
semconv.NetSockPeerNameKey: 2,
semconv.NetSockPeerAddrKey: 3,
keyPeerHostname: 4,
keyPeerAddress: 5,
semconv.DBNameKey: 6,
}

func toZipkinRemoteEndpoint(data tracesdk.ReadOnlySpan) *zkmodel.Endpoint {
Expand Down Expand Up @@ -273,7 +273,7 @@ func toZipkinRemoteEndpoint(data tracesdk.ReadOnlySpan) *zkmodel.Endpoint {
return nil
}

if endpointAttr.Key != semconv.NetPeerIPKey &&
if endpointAttr.Key != semconv.NetSockPeerAddrKey &&
endpointAttr.Value.Type() == attribute.STRING {
return &zkmodel.Endpoint{
ServiceName: endpointAttr.Value.AsString(),
Expand All @@ -300,7 +300,7 @@ func remoteEndpointPeerIPWithPort(peerIP string, attrs []attribute.KeyValue) *zk
}

for _, kv := range attrs {
if kv.Key == semconv.NetPeerPortKey {
if kv.Key == semconv.NetSockPeerPortKey {
port, _ := strconv.ParseUint(kv.Value.Emit(), 10, 16)
endpoint.Port = uint16(port)
return endpoint
Expand Down
46 changes: 22 additions & 24 deletions exporters/zipkin/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"go.opentelemetry.io/otel/sdk/resource"
tracesdk "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/sdk/trace/tracetest"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down Expand Up @@ -291,8 +291,8 @@ func TestModelConversion(t *testing.T) {
attribute.Int64("attr1", 42),
attribute.String("attr2", "bar"),
attribute.String("peer.hostname", "test-peer-hostname"),
attribute.String("net.peer.ip", "1.2.3.4"),
attribute.Int64("net.peer.port", 9876),
attribute.String("net.sock.peer.addr", "1.2.3.4"),
attribute.Int64("net.sock.peer.port", 9876),
},
Events: []tracesdk.Event{
{
Expand Down Expand Up @@ -745,17 +745,17 @@ func TestModelConversion(t *testing.T) {
},
},
Tags: map[string]string{
"attr1": "42",
"attr2": "bar",
"net.peer.ip": "1.2.3.4",
"net.peer.port": "9876",
"peer.hostname": "test-peer-hostname",
"otel.status_code": "ERROR",
"error": "404, file not found",
"service.name": "model-test",
"service.version": "0.1.0",
"resource-attr1": "42",
"resource-attr2": "[0,1,2]",
"attr1": "42",
"attr2": "bar",
"net.sock.peer.addr": "1.2.3.4",
"net.sock.peer.port": "9876",
"peer.hostname": "test-peer-hostname",
"otel.status_code": "ERROR",
"error": "404, file not found",
"service.name": "model-test",
"service.version": "0.1.0",
"resource-attr1": "42",
"resource-attr2": "[0,1,2]",
},
},
// model for span data of producer kind
Expand Down Expand Up @@ -1097,24 +1097,24 @@ func TestRemoteEndpointTransformation(t *testing.T) {
Attributes: []attribute.KeyValue{
semconv.PeerServiceKey.String("peer-service-test"),
semconv.NetPeerNameKey.String("peer-name-test"),
semconv.HTTPHostKey.String("http-host-test"),
semconv.NetSockPeerNameKey.String("net-sock-peer-test"),
},
},
want: &zkmodel.Endpoint{
ServiceName: "peer-service-test",
},
},
{
name: "http-host-rank",
name: "net-sock-peer-rank",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
semconv.HTTPHostKey.String("http-host-test"),
semconv.NetSockPeerNameKey.String("net-sock-peer-test"),
semconv.DBNameKey.String("db-name-test"),
},
},
want: &zkmodel.Endpoint{
ServiceName: "http-host-test",
ServiceName: "net-sock-peer-test",
},
},
{
Expand All @@ -1137,7 +1137,6 @@ func TestRemoteEndpointTransformation(t *testing.T) {
Attributes: []attribute.KeyValue{
keyPeerHostname.String("peer-hostname-test"),
keyPeerAddress.String("peer-address-test"),
semconv.HTTPHostKey.String("http-host-test"),
semconv.DBNameKey.String("http-host-test"),
},
},
Expand All @@ -1151,7 +1150,6 @@ func TestRemoteEndpointTransformation(t *testing.T) {
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
keyPeerAddress.String("peer-address-test"),
semconv.HTTPHostKey.String("http-host-test"),
semconv.DBNameKey.String("http-host-test"),
},
},
Expand All @@ -1164,7 +1162,7 @@ func TestRemoteEndpointTransformation(t *testing.T) {
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
semconv.NetPeerIPKey.String("INVALID"),
semconv.NetSockPeerAddrKey.String("INVALID"),
},
},
want: nil,
Expand All @@ -1174,7 +1172,7 @@ func TestRemoteEndpointTransformation(t *testing.T) {
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
semconv.NetPeerIPKey.String("0:0:1:5ee:bad:c0de:0:0"),
semconv.NetSockPeerAddrKey.String("0:0:1:5ee:bad:c0de:0:0"),
},
},
want: &zkmodel.Endpoint{
Expand All @@ -1186,8 +1184,8 @@ func TestRemoteEndpointTransformation(t *testing.T) {
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
semconv.NetPeerIPKey.String("1.2.3.4"),
semconv.NetPeerPortKey.Int(9876),
semconv.NetSockPeerAddrKey.String("1.2.3.4"),
semconv.NetSockPeerPortKey.Int(9876),
},
},
want: &zkmodel.Endpoint{
Expand Down
2 changes: 1 addition & 1 deletion exporters/zipkin/zipkin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/sdk/trace/tracetest"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
2 changes: 1 addition & 1 deletion sdk/metric/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"go.opentelemetry.io/otel/metric/global"
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

func Example() {
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/auto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

func TestDetect(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"os"
"regexp"

semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

type containerIDProvider func() (string, error)
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"go.opentelemetry.io/otel/attribute"
ottest "go.opentelemetry.io/otel/internal/internaltest"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

func TestDetectOnePair(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"strings"

"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

type osDescriptionProvider func() (string, error)
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

func mockRuntimeProviders() {
Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"path/filepath"
"runtime"

semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
semconv "go.opentelemetry.io/otel/semconv/v1.16.0"
)

type pidProvider func() int
Expand Down
Loading

0 comments on commit 78a5582

Please sign in to comment.