diff --git a/util/tracing/detect/resource.go b/util/tracing/detect/resource.go index 79abea9526cb..5f263e0fd5d6 100644 --- a/util/tracing/detect/resource.go +++ b/util/tracing/detect/resource.go @@ -8,7 +8,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" ) var ( diff --git a/util/tracing/detect/resource_test.go b/util/tracing/detect/resource_test.go new file mode 100644 index 000000000000..3863b4ffa3d0 --- /dev/null +++ b/util/tracing/detect/resource_test.go @@ -0,0 +1,29 @@ +package detect + +import ( + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel" +) + +func TestResource(t *testing.T) { + prevHandler := otel.GetErrorHandler() + t.Cleanup(func() { + otel.SetErrorHandler(prevHandler) + }) + + var resourceErr error + otel.SetErrorHandler(otel.ErrorHandlerFunc(func(err error) { + resourceErr = err + })) + + res := Resource() + + // Should not have an empty schema url. Only happens when + // there is a schema conflict. + require.NotEqual(t, "", res.SchemaURL()) + + // No error should have been invoked. + require.NoError(t, resourceErr) +} diff --git a/util/tracing/tracing.go b/util/tracing/tracing.go index bf3301da4dc0..2df1c4627387 100644 --- a/util/tracing/tracing.go +++ b/util/tracing/tracing.go @@ -11,7 +11,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/noop"