diff --git a/detectors/aws/ec2/ec2.go b/detectors/aws/ec2/ec2.go index 950a97ffcce..d2089f41755 100644 --- a/detectors/aws/ec2/ec2.go +++ b/detectors/aws/ec2/ec2.go @@ -25,7 +25,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.17.0" ) type config struct { diff --git a/detectors/aws/ec2/ec2_test.go b/detectors/aws/ec2/ec2_test.go index c77ca3bbe61..c4005f44ece 100644 --- a/detectors/aws/ec2/ec2_test.go +++ b/detectors/aws/ec2/ec2_test.go @@ -28,7 +28,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.17.0" ) func TestAWS_Detect(t *testing.T) { diff --git a/detectors/aws/ec2/go.mod b/detectors/aws/ec2/go.mod index cd733e04a6d..46b1f86df2e 100644 --- a/detectors/aws/ec2/go.mod +++ b/detectors/aws/ec2/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/aws/aws-sdk-go v1.44.184 github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/detectors/aws/ec2/go.sum b/detectors/aws/ec2/go.sum index 6b93d430feb..79aabcfc326 100644 --- a/detectors/aws/ec2/go.sum +++ b/detectors/aws/ec2/go.sum @@ -24,8 +24,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/detectors/aws/ecs/ecs.go b/detectors/aws/ecs/ecs.go index 34c3ba83dc7..df676c82118 100644 --- a/detectors/aws/ecs/ecs.go +++ b/detectors/aws/ecs/ecs.go @@ -28,7 +28,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.17.0" ) const ( diff --git a/detectors/aws/ecs/ecs_test.go b/detectors/aws/ecs/ecs_test.go index 4d155809da8..7f50cbd83f6 100644 --- a/detectors/aws/ecs/ecs_test.go +++ b/detectors/aws/ecs/ecs_test.go @@ -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.17.0" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/detectors/aws/ecs/go.mod b/detectors/aws/ecs/go.mod index 517f5e2da16..934d1a0538a 100644 --- a/detectors/aws/ecs/go.mod +++ b/detectors/aws/ecs/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/brunoscheufler/aws-ecs-metadata-go v0.0.0-20220812150832-b6b31c6eeeaf github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/detectors/aws/ecs/go.sum b/detectors/aws/ecs/go.sum index fdc3e892322..a6980c22828 100644 --- a/detectors/aws/ecs/go.sum +++ b/detectors/aws/ecs/go.sum @@ -19,8 +19,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/detectors/aws/ecs/test/ecs_test.go b/detectors/aws/ecs/test/ecs_test.go index 1cdcc968623..74cda1c3129 100644 --- a/detectors/aws/ecs/test/ecs_test.go +++ b/detectors/aws/ecs/test/ecs_test.go @@ -25,7 +25,7 @@ import ( ecs "go.opentelemetry.io/contrib/detectors/aws/ecs" "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.17.0" "github.com/stretchr/testify/assert" ) diff --git a/detectors/aws/eks/detector.go b/detectors/aws/eks/detector.go index c1b29fcb921..22e2285ce9b 100644 --- a/detectors/aws/eks/detector.go +++ b/detectors/aws/eks/detector.go @@ -27,7 +27,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.17.0" ) const ( diff --git a/detectors/aws/eks/detector_test.go b/detectors/aws/eks/detector_test.go index 68b37d746e6..5ebea5fc55d 100644 --- a/detectors/aws/eks/detector_test.go +++ b/detectors/aws/eks/detector_test.go @@ -24,7 +24,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.17.0" ) type MockDetectorUtils struct { diff --git a/detectors/aws/eks/go.mod b/detectors/aws/eks/go.mod index 1e6acca04e9..28a4f9725c0 100644 --- a/detectors/aws/eks/go.mod +++ b/detectors/aws/eks/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 k8s.io/apimachinery v0.26.1 k8s.io/client-go v0.26.1 diff --git a/detectors/aws/eks/go.sum b/detectors/aws/eks/go.sum index 230dbad8b4d..01dcda1ab99 100644 --- a/detectors/aws/eks/go.sum +++ b/detectors/aws/eks/go.sum @@ -184,8 +184,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/detectors/aws/lambda/detector.go b/detectors/aws/lambda/detector.go index 07cea8f57bd..688e5d041a1 100644 --- a/detectors/aws/lambda/detector.go +++ b/detectors/aws/lambda/detector.go @@ -22,7 +22,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.17.0" ) // For a complete list of reserved environment variables in Lambda, see: diff --git a/detectors/aws/lambda/detector_test.go b/detectors/aws/lambda/detector_test.go index 311362d8cdd..a275824feec 100644 --- a/detectors/aws/lambda/detector_test.go +++ b/detectors/aws/lambda/detector_test.go @@ -23,7 +23,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.17.0" ) // successfully return resource when process is running on Amazon Lambda environment. diff --git a/detectors/aws/lambda/go.mod b/detectors/aws/lambda/go.mod index 007e0629b08..3f49c0b12a0 100644 --- a/detectors/aws/lambda/go.mod +++ b/detectors/aws/lambda/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/detectors/aws/lambda/go.sum b/detectors/aws/lambda/go.sum index 90b60c12543..e0f1ffa78ff 100644 --- a/detectors/aws/lambda/go.sum +++ b/detectors/aws/lambda/go.sum @@ -16,8 +16,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/detectors/gcp/cloud-function.go b/detectors/gcp/cloud-function.go index 9788dbf8633..1384735c543 100644 --- a/detectors/gcp/cloud-function.go +++ b/detectors/gcp/cloud-function.go @@ -20,7 +20,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.17.0" ) const ( diff --git a/detectors/gcp/cloud-function_test.go b/detectors/gcp/cloud-function_test.go index de4ac87299e..e26e6ffde16 100644 --- a/detectors/gcp/cloud-function_test.go +++ b/detectors/gcp/cloud-function_test.go @@ -24,7 +24,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.17.0" ) var ( diff --git a/detectors/gcp/cloud-run.go b/detectors/gcp/cloud-run.go index a7e5a14416d..66daa0c6223 100644 --- a/detectors/gcp/cloud-run.go +++ b/detectors/gcp/cloud-run.go @@ -24,7 +24,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.17.0" ) const serviceNamespace = "cloud-run-managed" diff --git a/detectors/gcp/detector.go b/detectors/gcp/detector.go index be7ac1d105a..9d0051dc2e7 100644 --- a/detectors/gcp/detector.go +++ b/detectors/gcp/detector.go @@ -23,7 +23,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.17.0" ) // NewDetector returns a resource detector which detects resource attributes on: diff --git a/detectors/gcp/detector_test.go b/detectors/gcp/detector_test.go index 58a581744dd..fc836a7bf68 100644 --- a/detectors/gcp/detector_test.go +++ b/detectors/gcp/detector_test.go @@ -24,7 +24,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.17.0" ) func TestDetect(t *testing.T) { diff --git a/detectors/gcp/gce.go b/detectors/gcp/gce.go index e64be967d0e..197b54b47b5 100644 --- a/detectors/gcp/gce.go +++ b/detectors/gcp/gce.go @@ -24,7 +24,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.17.0" ) // GCE collects resource information of GCE computing instances. diff --git a/detectors/gcp/gke.go b/detectors/gcp/gke.go index 9a4041577d5..9a24dbeb417 100644 --- a/detectors/gcp/gke.go +++ b/detectors/gcp/gke.go @@ -23,7 +23,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.17.0" ) // GKE collects resource information of GKE computing instances. diff --git a/detectors/gcp/go.mod b/detectors/gcp/go.mod index e1d780e0623..85c59d7255e 100644 --- a/detectors/gcp/go.mod +++ b/detectors/gcp/go.mod @@ -7,7 +7,7 @@ require ( github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v0.34.2 github.com/google/go-cmp v0.5.9 github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/detectors/gcp/go.sum b/detectors/gcp/go.sum index 1e1c6e93304..0d2b2dc57d8 100644 --- a/detectors/gcp/go.sum +++ b/detectors/gcp/go.sum @@ -23,8 +23,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/dispatcher.go b/instrumentation/github.com/Shopify/sarama/otelsarama/dispatcher.go index c6128e33103..a40cbc80e20 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/dispatcher.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/dispatcher.go @@ -22,7 +22,7 @@ import ( "github.com/Shopify/sarama" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) @@ -63,10 +63,10 @@ func (w *consumerMessagesDispatcherWrapper) Run() { attrs := []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(msg.Topic), + semconv.MessagingDestinationNameKey.String(msg.Topic), semconv.MessagingOperationReceive, semconv.MessagingMessageIDKey.String(strconv.FormatInt(msg.Offset, 10)), - semconv.MessagingKafkaPartitionKey.Int64(int64(msg.Partition)), + semconv.MessagingKafkaSourcePartitionKey.Int64(int64(msg.Partition)), } opts := []trace.SpanStartOption{ trace.WithAttributes(attrs...), diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/consumer/consumer.go b/instrumentation/github.com/Shopify/sarama/otelsarama/example/consumer/consumer.go index 9b90da1770f..299b384cec5 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/consumer/consumer.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/consumer/consumer.go @@ -27,7 +27,7 @@ import ( "github.com/Shopify/sarama" "go.opentelemetry.io/otel" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama" diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.mod b/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.mod index 22a65625abd..e890deaed78 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.mod +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.mod @@ -7,7 +7,7 @@ replace go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/ot require ( github.com/Shopify/sarama v1.38.0 go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.sum b/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.sum index c37d545fd01..d93d975900e 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.sum +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.sum @@ -54,8 +54,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/go.mod b/instrumentation/github.com/Shopify/sarama/otelsarama/go.mod index af0036108b3..62e4340b805 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/go.mod +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/Shopify/sarama v1.38.0 github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/go.sum b/instrumentation/github.com/Shopify/sarama/otelsarama/go.sum index 222b8e90616..7a9c65db3eb 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/go.sum +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/go.sum @@ -62,8 +62,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/producer.go b/instrumentation/github.com/Shopify/sarama/otelsarama/producer.go index 2e78cf0df61..cc34bec98e9 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/producer.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/producer.go @@ -26,7 +26,7 @@ import ( "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) @@ -287,7 +287,7 @@ func startProducerSpan(cfg config, version sarama.KafkaVersion, msg *sarama.Prod attrs := []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(msg.Topic), + semconv.MessagingDestinationNameKey.String(msg.Topic), semconv.MessagingMessagePayloadSizeBytesKey.Int(msgPayloadSize(msg, version)), semconv.MessagingOperationKey.String("send"), } @@ -308,7 +308,7 @@ func startProducerSpan(cfg config, version sarama.KafkaVersion, msg *sarama.Prod func finishProducerSpan(span trace.Span, partition int32, offset int64, err error) { span.SetAttributes( semconv.MessagingMessageIDKey.String(strconv.FormatInt(offset, 10)), - semconv.MessagingKafkaPartitionKey.Int64(int64(partition)), + semconv.MessagingKafkaDestinationPartitionKey.Int64(int64(partition)), ) if err != nil { span.SetStatus(codes.Error, err.Error()) diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/test/consumer_test.go b/instrumentation/github.com/Shopify/sarama/otelsarama/test/consumer_test.go index 81d3c101a02..c5f449b0d45 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/test/consumer_test.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/test/consumer_test.go @@ -29,7 +29,7 @@ import ( "go.opentelemetry.io/otel/propagation" 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.17.0" "go.opentelemetry.io/otel/trace" ) @@ -109,10 +109,10 @@ func consumeAndCheck(t *testing.T, mt trace.Tracer, complFn func() []sdktrace.Re attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String("test-topic"), + semconv.MessagingDestinationNameKey.String("test-topic"), semconv.MessagingOperationReceive, semconv.MessagingMessageIDKey.String("0"), - semconv.MessagingKafkaPartitionKey.Int64(0), + semconv.MessagingKafkaSourcePartitionKey.Int64(0), }, parentSpanID: trace.SpanContextFromContext(ctx).SpanID(), kind: trace.SpanKindConsumer, @@ -122,10 +122,10 @@ func consumeAndCheck(t *testing.T, mt trace.Tracer, complFn func() []sdktrace.Re attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String("test-topic"), + semconv.MessagingDestinationNameKey.String("test-topic"), semconv.MessagingOperationReceive, semconv.MessagingMessageIDKey.String("1"), - semconv.MessagingKafkaPartitionKey.Int64(0), + semconv.MessagingKafkaSourcePartitionKey.Int64(0), }, kind: trace.SpanKindConsumer, msgKey: []byte("foo2"), diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/test/go.mod b/instrumentation/github.com/Shopify/sarama/otelsarama/test/go.mod index 982c06809e2..9778842a3ef 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/test/go.mod +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/test/go.mod @@ -6,7 +6,7 @@ require ( github.com/Shopify/sarama v1.38.0 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/test/go.sum b/instrumentation/github.com/Shopify/sarama/otelsarama/test/go.sum index 070f6840bb7..8656dfb6978 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/test/go.sum +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/test/go.sum @@ -59,8 +59,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/test/producer_test.go b/instrumentation/github.com/Shopify/sarama/otelsarama/test/producer_test.go index b6b5679063c..f60f88e1bc4 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/test/producer_test.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/test/producer_test.go @@ -32,7 +32,7 @@ import ( "go.opentelemetry.io/otel/propagation" "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.17.0" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -66,9 +66,9 @@ func TestWrapSyncProducer(t *testing.T) { attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(topic), + semconv.MessagingDestinationNameKey.String(topic), semconv.MessagingMessageIDKey.String("1"), - semconv.MessagingKafkaPartitionKey.Int64(0), + semconv.MessagingKafkaDestinationPartitionKey.Int64(0), }, parentSpanID: oteltrace.SpanContextFromContext(ctx).SpanID(), kind: oteltrace.SpanKindProducer, @@ -77,9 +77,9 @@ func TestWrapSyncProducer(t *testing.T) { attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(topic), + semconv.MessagingDestinationNameKey.String(topic), semconv.MessagingMessageIDKey.String("2"), - semconv.MessagingKafkaPartitionKey.Int64(0), + semconv.MessagingKafkaDestinationPartitionKey.Int64(0), }, kind: oteltrace.SpanKindProducer, }, @@ -87,11 +87,11 @@ func TestWrapSyncProducer(t *testing.T) { attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(topic), + semconv.MessagingDestinationNameKey.String(topic), // TODO: The mock sync producer of sarama does not handle the offset while sending messages // https://github.com/Shopify/sarama/pull/1747 //semconv.MessagingMessageIDKey.String("3"), - semconv.MessagingKafkaPartitionKey.Int64(12), + semconv.MessagingKafkaDestinationPartitionKey.Int64(12), }, kind: oteltrace.SpanKindProducer, }, @@ -99,9 +99,9 @@ func TestWrapSyncProducer(t *testing.T) { attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(topic), + semconv.MessagingDestinationNameKey.String(topic), //semconv.MessagingMessageIDKey.String("4"), - semconv.MessagingKafkaPartitionKey.Int64(25), + semconv.MessagingKafkaDestinationPartitionKey.Int64(25), }, kind: oteltrace.SpanKindProducer, }, @@ -188,7 +188,7 @@ func TestWrapAsyncProducer(t *testing.T) { attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(topic), + semconv.MessagingDestinationNameKey.String(topic), }, kind: oteltrace.SpanKindProducer, }, @@ -196,7 +196,7 @@ func TestWrapAsyncProducer(t *testing.T) { attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(topic), + semconv.MessagingDestinationNameKey.String(topic), }, kind: oteltrace.SpanKindProducer, }, @@ -256,9 +256,9 @@ func TestWrapAsyncProducer(t *testing.T) { attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(topic), + semconv.MessagingDestinationNameKey.String(topic), semconv.MessagingMessageIDKey.String("1"), - semconv.MessagingKafkaPartitionKey.Int64(9), + semconv.MessagingKafkaDestinationPartitionKey.Int64(9), }, kind: oteltrace.SpanKindProducer, }, @@ -266,9 +266,9 @@ func TestWrapAsyncProducer(t *testing.T) { attributeList: []attribute.KeyValue{ semconv.MessagingSystemKey.String("kafka"), semconv.MessagingDestinationKindTopic, - semconv.MessagingDestinationKey.String(topic), + semconv.MessagingDestinationNameKey.String(topic), semconv.MessagingMessageIDKey.String("2"), - semconv.MessagingKafkaPartitionKey.Int64(31), + semconv.MessagingKafkaDestinationPartitionKey.Int64(31), }, kind: oteltrace.SpanKindProducer, }, diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/beego.go b/instrumentation/github.com/astaxie/beego/otelbeego/beego.go index 1abd011de49..8a25d6c1e03 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/beego.go +++ b/instrumentation/github.com/astaxie/beego/otelbeego/beego.go @@ -50,7 +50,7 @@ func (o *Handler) ServeHTTP(rr http.ResponseWriter, req *http.Request) { // defaultSpanNameFormatter is the default formatter for spans created with the beego // integration. Returns the route path template, or the URL path if the current path // is not associated with a router. -func defaultSpanNameFormatter(operation string, req *http.Request) string { +func defaultSpanNameFormatter(_ string, req *http.Request) string { if val := req.Context().Value(internal.CtxRouteTemplateKey); val != nil { str, ok := val.(string) if ok { @@ -71,6 +71,7 @@ func NewOTelBeegoMiddleWare(service string, options ...Option) beego.MiddleWare otelhttp.WithTracerProvider(cfg.tracerProvider), otelhttp.WithMeterProvider(cfg.meterProvider), otelhttp.WithPropagators(cfg.propagators), + otelhttp.WithServerName(service), } for _, f := range cfg.filters { @@ -88,7 +89,7 @@ func NewOTelBeegoMiddleWare(service string, options ...Option) beego.MiddleWare return &Handler{ otelhttp.NewHandler( handler, - service, + "", httpOptions..., ), } diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/example/go.mod b/instrumentation/github.com/astaxie/beego/otelbeego/example/go.mod index 7f8c3946a81..42985a58b81 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/example/go.mod +++ b/instrumentation/github.com/astaxie/beego/otelbeego/example/go.mod @@ -11,7 +11,7 @@ replace ( require ( github.com/astaxie/beego v1.12.3 go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/example/go.sum b/instrumentation/github.com/astaxie/beego/otelbeego/example/go.sum index 90dbbc2b57a..071ddac0bbd 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/example/go.sum +++ b/instrumentation/github.com/astaxie/beego/otelbeego/example/go.sum @@ -260,8 +260,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/example/server/server.go b/instrumentation/github.com/astaxie/beego/otelbeego/example/server/server.go index 4261e32d39d..d7bdfd6917f 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/example/server/server.go +++ b/instrumentation/github.com/astaxie/beego/otelbeego/example/server/server.go @@ -27,7 +27,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.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/go.mod b/instrumentation/github.com/astaxie/beego/otelbeego/go.mod index a0d7d69a36e..73f4b1c9492 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/go.mod +++ b/instrumentation/github.com/astaxie/beego/otelbeego/go.mod @@ -8,7 +8,7 @@ require ( github.com/astaxie/beego v1.12.3 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/metric v0.34.0 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/go.sum b/instrumentation/github.com/astaxie/beego/otelbeego/go.sum index 06166c802bc..88003f93fd3 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/go.sum +++ b/instrumentation/github.com/astaxie/beego/otelbeego/go.sum @@ -265,8 +265,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/test/beego_test.go b/instrumentation/github.com/astaxie/beego/otelbeego/test/beego_test.go index f6453ac5656..4968299e028 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/test/beego_test.go +++ b/instrumentation/github.com/astaxie/beego/otelbeego/test/beego_test.go @@ -32,7 +32,7 @@ import ( "go.opentelemetry.io/otel/propagation" "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.17.0" "github.com/astaxie/beego" beegoCtx "github.com/astaxie/beego/context" @@ -329,9 +329,8 @@ func runTest(t *testing.T, tc *testCase, url string) { func defaultAttributes() []attribute.KeyValue { return []attribute.KeyValue{ - semconv.HTTPServerNameKey.String(middleWareName), + semconv.NetHostNameKey.String(middleWareName), semconv.HTTPSchemeHTTP, - semconv.HTTPHostKey.String("localhost"), } } diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/test/go.mod b/instrumentation/github.com/astaxie/beego/otelbeego/test/go.mod index 1432c57182f..f40a4b037d3 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/test/go.mod +++ b/instrumentation/github.com/astaxie/beego/otelbeego/test/go.mod @@ -7,7 +7,7 @@ require ( github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego v0.37.0 go.opentelemetry.io/contrib/propagators/b3 v1.12.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/test/go.sum b/instrumentation/github.com/astaxie/beego/otelbeego/test/go.sum index da9d39cd279..5b2577daae0 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/test/go.sum +++ b/instrumentation/github.com/astaxie/beego/otelbeego/test/go.sum @@ -265,8 +265,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.mod b/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.mod index 38dc6106d45..f56f621e806 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.mod +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.mod @@ -17,7 +17,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.37.0 go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.37.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.sum b/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.sum index 714fe1c28a1..2c70a67241d 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.sum +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.sum @@ -61,8 +61,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/go.mod b/instrumentation/github.com/aws/aws-lambda-go/otellambda/go.mod index d9eada5543f..5ca207ed17c 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/go.mod +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/aws/aws-lambda-go v1.37.0 github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/go.sum b/instrumentation/github.com/aws/aws-lambda-go/otellambda/go.sum index 1dab1bee4bb..236d559f20f 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/go.sum +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go b/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go index 0a5c6156700..b7101c65f79 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go @@ -24,7 +24,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.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/go.mod b/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/go.mod index ead45be69b7..2e465eac52e 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/go.mod +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/contrib/detectors/aws/lambda v0.37.0 go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.37.0 go.opentelemetry.io/contrib/propagators/aws v1.12.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/go.sum b/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/go.sum index b8d9e54df12..5a552ed8c16 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/go.sum +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/lambda_test.go b/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/lambda_test.go index 87b246f24b6..06c8b9ae145 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/lambda_test.go +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/test/lambda_test.go @@ -40,7 +40,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.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/go.mod b/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/go.mod index 836ae416a0e..92503550134 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/go.mod +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/contrib/detectors/aws/lambda v0.37.0 go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.37.0 go.opentelemetry.io/contrib/propagators/aws v1.12.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/go.sum b/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/go.sum index ca87822fb4b..514c4feb895 100644 --- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/go.sum +++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/go.sum @@ -165,8 +165,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.2 h1:htgM8vZIF8oPSCxa341e3IZ4yr/sKxgu8KZYllByiVY= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.2/go.mod h1:rqbht/LlhVBgn5+k3M5QK96K5Xb0DvXpMJ5SFQpY6uw= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.2 h1:fqR1kli93643au1RKo0Uma3d2aPQKT+WBKfTSBaKbOc= diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go index 463ea24cafb..56ed6d81c82 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go @@ -26,7 +26,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/dynamodbattributes.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/dynamodbattributes.go index 530f9d8ad5a..8f814e87710 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/dynamodbattributes.go +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/dynamodbattributes.go @@ -22,7 +22,7 @@ import ( "github.com/aws/smithy-go/middleware" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) // DynamoDBAttributeSetter sets DynamoDB specific attributes depending on the DynamoDB operation being performed. diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.mod b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.mod index 2be174ea69f..4667dfc15bc 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.mod +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.mod @@ -10,7 +10,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/dynamodb v1.18.0 github.com/aws/aws-sdk-go-v2/service/s3 v1.30.0 go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.sum b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.sum index a61e29d6f0f..cd7cb164c4c 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.sum +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.sum @@ -57,8 +57,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.mod b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.mod index 3af4e98812c..7bd42360fa6 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.mod +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.mod @@ -8,7 +8,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sqs v1.20.0 github.com/aws/smithy-go v1.13.5 github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.sum b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.sum index 92c003c33b2..986962ec8ce 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.sum +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.sum @@ -37,8 +37,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go index 91b82bd7a41..edffc42e69c 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go @@ -21,42 +21,43 @@ import ( "github.com/aws/smithy-go/middleware" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) // SQSAttributeSetter sets SQS specific attributes depending on the SQS operation being performed. func SQSAttributeSetter(ctx context.Context, in middleware.InitializeInput) []attribute.KeyValue { sqsAttributes := []attribute.KeyValue{semconv.MessagingSystemKey.String("AmazonSQS")} + key := semconv.NetPeerNameKey switch v := in.Parameters.(type) { case *sqs.DeleteMessageBatchInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.DeleteMessageInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.DeleteQueueInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.GetQueueAttributesInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.ListDeadLetterSourceQueuesInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.ListQueueTagsInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.PurgeQueueInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.ReceiveMessageInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.RemovePermissionInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.SendMessageBatchInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.SendMessageInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.SetQueueAttributesInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.TagQueueInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) case *sqs.UntagQueueInput: - sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl)) + sqsAttributes = append(sqsAttributes, key.String(*v.QueueUrl)) } return sqsAttributes diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes_test.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes_test.go index cb2115b0ea5..e3d12638e05 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes_test.go +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes_test.go @@ -23,7 +23,7 @@ import ( "github.com/aws/smithy-go/middleware" "github.com/stretchr/testify/assert" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) func TestSQSDeleteMessageBatchInput(t *testing.T) { @@ -35,7 +35,7 @@ func TestSQSDeleteMessageBatchInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSDeleteMessageInput(t *testing.T) { @@ -47,7 +47,7 @@ func TestSQSDeleteMessageInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSDeleteQueueInput(t *testing.T) { @@ -59,7 +59,7 @@ func TestSQSDeleteQueueInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSGetQueueAttributesInput(t *testing.T) { @@ -71,7 +71,7 @@ func TestSQSGetQueueAttributesInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSListDeadLetterSourceQueuesInput(t *testing.T) { @@ -83,7 +83,7 @@ func TestSQSListDeadLetterSourceQueuesInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSListQueueTagsInput(t *testing.T) { @@ -95,7 +95,7 @@ func TestSQSListQueueTagsInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSPurgeQueueInput(t *testing.T) { @@ -107,7 +107,7 @@ func TestSQSPurgeQueueInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSReceiveMessageInput(t *testing.T) { @@ -119,7 +119,7 @@ func TestSQSReceiveMessageInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSRemovePermissionInput(t *testing.T) { @@ -131,7 +131,7 @@ func TestSQSRemovePermissionInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSSendMessageBatchInput(t *testing.T) { @@ -143,7 +143,7 @@ func TestSQSSendMessageBatchInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSSendMessageInput(t *testing.T) { @@ -155,7 +155,7 @@ func TestSQSSendMessageInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSSetQueueAttributesInput(t *testing.T) { @@ -167,7 +167,7 @@ func TestSQSSetQueueAttributesInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSTagQueueInput(t *testing.T) { @@ -179,7 +179,7 @@ func TestSQSTagQueueInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } func TestSQSUntagQueueInput(t *testing.T) { @@ -191,5 +191,5 @@ func TestSQSUntagQueueInput(t *testing.T) { attributes := SQSAttributeSetter(context.TODO(), input) - assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url")) + assert.Contains(t, attributes, semconv.NetPeerNameKey.String("test-queue-url")) } diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.mod b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.mod index 8927a6376f7..f7da0e0348f 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.mod +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.mod @@ -9,7 +9,7 @@ require ( github.com/aws/smithy-go v1.13.5 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.sum b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.sum index 7e12ed57fd2..a5f5c1f05dc 100644 --- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.sum +++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.sum @@ -39,8 +39,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.mod b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.mod index 8b1f23da7b6..49d06ed065b 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.mod +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.mod @@ -14,7 +14,7 @@ require ( require ( github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - go.opentelemetry.io/otel v1.11.2 // indirect + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f // indirect go.opentelemetry.io/otel/trace v1.11.2 // indirect golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect ) diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.sum b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.sum index 8bfbaa357d7..e732e53d99a 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.sum +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.sum @@ -9,8 +9,8 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.mod b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.mod index 66cf8fcd932..eb96d472869 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.mod +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.sum b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.sum index 8ea8ebd855d..8eeff9e0a90 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.sum +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/internal/attributes.go b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/internal/attributes.go index 1a7d7555b6b..c92f4ded202 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/internal/attributes.go +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/internal/attributes.go @@ -16,7 +16,7 @@ package internal // import "go.opentelemetry.io/contrib/instrumentation/github.c import ( "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) type Operation string diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/go.mod b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/go.mod index 3918177eb1c..1c23de6bfb8 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/go.mod +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/go.mod @@ -7,7 +7,7 @@ require ( github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib v1.12.0 go.opentelemetry.io/contrib/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/go.sum b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/go.sum index 3fba848de02..d0a0acd0968 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/go.sum +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.mod b/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.mod index 7af23337469..0d55d62a3dc 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.mod +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/emicklei/go-restful/v3 v3.10.1 go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.sum b/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.sum index 9d0a7c061e2..abbd1588bf2 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.sum +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.sum @@ -21,8 +21,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/go.mod b/instrumentation/github.com/emicklei/go-restful/otelrestful/go.mod index 3fa8fb69c00..7e4816f382f 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/go.mod +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/go.mod @@ -8,7 +8,7 @@ require ( github.com/emicklei/go-restful/v3 v3.10.1 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/propagators/b3 v1.12.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/go.sum b/instrumentation/github.com/emicklei/go-restful/otelrestful/go.sum index 16b7fb846d0..9e705fc874c 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/go.sum +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/go.sum @@ -26,8 +26,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/restful.go b/instrumentation/github.com/emicklei/go-restful/otelrestful/restful.go index 9ccb13dc3de..05239a9e827 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/restful.go +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/restful.go @@ -19,7 +19,8 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + "go.opentelemetry.io/otel/semconv/v1.15.0/httpconv" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -51,12 +52,20 @@ func OTelFilter(service string, opts ...Option) restful.FilterFunction { route := req.SelectedRoutePath() spanName := route - ctx, span := tracer.Start(ctx, spanName, - oteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", r)...), - oteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(r)...), - oteltrace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(service, route, r)...), + opts := []oteltrace.SpanStartOption{ + oteltrace.WithAttributes(httpconv.ServerRequest(r)...), + // TODO: pass service to ServerRequest when + // https://github.com/open-telemetry/opentelemetry-go/pull/3619 is + // merged, and remove this. + oteltrace.WithAttributes(semconv.NetHostNameKey.String(service)), oteltrace.WithSpanKind(oteltrace.SpanKindServer), - ) + } + if route != "" { + rAttr := semconv.HTTPRouteKey.String(route) + opts = append(opts, oteltrace.WithAttributes(rAttr)) + } + + ctx, span := tracer.Start(ctx, spanName, opts...) defer span.End() // pass the span through the request context @@ -64,9 +73,10 @@ func OTelFilter(service string, opts ...Option) restful.FilterFunction { chain.ProcessFilter(req, resp) - attrs := semconv.HTTPAttributesFromHTTPStatusCode(resp.StatusCode()) - spanStatus, spanMessage := semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(resp.StatusCode(), oteltrace.SpanKindServer) - span.SetAttributes(attrs...) - span.SetStatus(spanStatus, spanMessage) + status := resp.StatusCode() + span.SetStatus(httpconv.ServerStatus(status)) + if status > 0 { + span.SetAttributes(semconv.HTTPStatusCodeKey.Int(status)) + } } } diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/test/go.mod b/instrumentation/github.com/emicklei/go-restful/otelrestful/test/go.mod index 2fd8ec461ca..c758934361b 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/test/go.mod +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/test/go.mod @@ -6,7 +6,7 @@ require ( github.com/emicklei/go-restful/v3 v3.10.1 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/test/go.sum b/instrumentation/github.com/emicklei/go-restful/otelrestful/test/go.sum index c782fe73b8e..7219e63591b 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/test/go.sum +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/test/go.sum @@ -26,8 +26,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.mod b/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.mod index 3db3b9f7804..9e7529266e2 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.mod +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/gin-gonic/gin v1.8.2 go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.sum b/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.sum index c687b406ca1..361b4ab80e8 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.sum +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.sum @@ -64,8 +64,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go b/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go index 1c2ce785331..60ba72a5150 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go @@ -26,7 +26,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + "go.opentelemetry.io/otel/semconv/v1.16.0/httpconv" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -69,14 +70,19 @@ func Middleware(service string, opts ...Option) gin.HandlerFunc { }() ctx := cfg.Propagators.Extract(savedCtx, propagation.HeaderCarrier(c.Request.Header)) opts := []oteltrace.SpanStartOption{ - oteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", c.Request)...), - oteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(c.Request)...), - oteltrace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(service, c.FullPath(), c.Request)...), + oteltrace.WithAttributes(httpconv.ServerRequest(c.Request)...), + // TODO: pass service to ServerRequest when + // https://github.com/open-telemetry/opentelemetry-go/pull/3619 is + // merged, and remove this. + oteltrace.WithAttributes(semconv.NetHostNameKey.String(service)), oteltrace.WithSpanKind(oteltrace.SpanKindServer), } spanName := c.FullPath() if spanName == "" { spanName = fmt.Sprintf("HTTP %s route not found", c.Request.Method) + } else { + rAttr := semconv.HTTPRouteKey.String(spanName) + opts = append(opts, oteltrace.WithAttributes(rAttr)) } ctx, span := tracer.Start(ctx, spanName, opts...) defer span.End() @@ -88,10 +94,10 @@ func Middleware(service string, opts ...Option) gin.HandlerFunc { c.Next() status := c.Writer.Status() - attrs := semconv.HTTPAttributesFromHTTPStatusCode(status) - spanStatus, spanMessage := semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(status, oteltrace.SpanKindServer) - span.SetAttributes(attrs...) - span.SetStatus(spanStatus, spanMessage) + span.SetStatus(httpconv.ServerStatus(status)) + if status > 0 { + span.SetAttributes(semconv.HTTPStatusCodeKey.Int(status)) + } if len(c.Errors) > 0 { span.SetAttributes(attribute.String("gin.errors", c.Errors.String())) } diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/go.mod b/instrumentation/github.com/gin-gonic/gin/otelgin/go.mod index e25fb3ff248..dd70701de6d 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/go.mod +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/go.mod @@ -8,7 +8,7 @@ require ( github.com/gin-gonic/gin v1.8.2 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/propagators/b3 v1.12.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/go.sum b/instrumentation/github.com/gin-gonic/gin/otelgin/go.sum index 8c05e830168..9a6e15c2cf4 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/go.sum +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/go.sum @@ -64,8 +64,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M= diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/test/go.mod b/instrumentation/github.com/gin-gonic/gin/otelgin/test/go.mod index 128bb9bc7c1..0514fe2e728 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/test/go.mod +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/test/go.mod @@ -6,7 +6,7 @@ require ( github.com/gin-gonic/gin v1.8.2 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/test/go.sum b/instrumentation/github.com/gin-gonic/gin/otelgin/test/go.sum index cd00e27cc4e..239749188e5 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/test/go.sum +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/test/go.sum @@ -64,8 +64,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.mod b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.mod index 0b7aee64373..14f3a21ed24 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.mod +++ b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.mod @@ -8,7 +8,7 @@ require ( github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e github.com/prometheus/client_golang v1.14.0 go.opentelemetry.io/contrib/instrumentation/github.com/gocql/gocql/otelgocql v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/prometheus v0.34.0 go.opentelemetry.io/otel/exporters/zipkin v1.11.2 go.opentelemetry.io/otel/metric v0.34.0 diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum index 2c9acead978..b0f45a43658 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum +++ b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum @@ -221,8 +221,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/prometheus v0.34.0 h1:L5D+HxdaC/ORB47ribbTBbkXRZs9JzPjq0EoIOMWncM= go.opentelemetry.io/otel/exporters/prometheus v0.34.0/go.mod h1:6gUoJyfhoWqF0tOLaY0ZmKgkQRcvEQx6p5rVlKHp3s4= go.opentelemetry.io/otel/exporters/zipkin v1.11.2 h1:wGdWn04d1sEnxfO4TUF/UcQfEIu80IvqUXU1lENKyFg= diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/go.mod b/instrumentation/github.com/gocql/gocql/otelgocql/go.mod index 52db3380f67..43f638cab85 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/go.mod +++ b/instrumentation/github.com/gocql/gocql/otelgocql/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/metric v0.34.0 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/go.sum b/instrumentation/github.com/gocql/gocql/otelgocql/go.sum index 9390d7384c5..b4171c7c312 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/go.sum +++ b/instrumentation/github.com/gocql/gocql/otelgocql/go.sum @@ -33,8 +33,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/gocql_test.go b/instrumentation/github.com/gocql/gocql/otelgocql/gocql_test.go index 47ab8e70beb..cb97331d49e 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/gocql_test.go +++ b/instrumentation/github.com/gocql/gocql/otelgocql/gocql_test.go @@ -21,13 +21,13 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/contrib/instrumentation/github.com/gocql/gocql/otelgocql/internal" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) func TestHostOrIP(t *testing.T) { hostAndPort := "127.0.0.1:9042" attribute := internal.HostOrIP(hostAndPort) - assert.Equal(t, semconv.NetPeerIPKey, attribute.Key) + assert.Equal(t, semconv.NetSockPeerAddrKey, attribute.Key) assert.Equal(t, "127.0.0.1", attribute.Value.AsString()) hostAndPort = "exampleHost:9042" diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/internal/cass.go b/instrumentation/github.com/gocql/gocql/otelgocql/internal/cass.go index f44a9a83e8e..8ef61a016ef 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/internal/cass.go +++ b/instrumentation/github.com/gocql/gocql/otelgocql/internal/cass.go @@ -19,7 +19,7 @@ import ( "net" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) const ( @@ -84,7 +84,7 @@ func CassPeerPort(port int) attribute.KeyValue { // CassPeerIP returns the IP address of the cassandra // server as a semconv KeyValue pair (net.peer.ip). func CassPeerIP(ip string) attribute.KeyValue { - return semconv.NetPeerIPKey.String(ip) + return semconv.NetSockPeerAddrKey.String(ip) } // CassVersion returns the cql version as a KeyValue pair. diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/test/go.mod b/instrumentation/github.com/gocql/gocql/otelgocql/test/go.mod index 3ba67f4c3b1..ef63235aad5 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/test/go.mod +++ b/instrumentation/github.com/gocql/gocql/otelgocql/test/go.mod @@ -7,7 +7,7 @@ require ( github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib v1.12.0 go.opentelemetry.io/contrib/instrumentation/github.com/gocql/gocql/otelgocql v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/metric v0.34.0 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/sdk/metric v0.34.0 diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/test/go.sum b/instrumentation/github.com/gocql/gocql/otelgocql/test/go.sum index 24f237899a8..49c776d26e0 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/test/go.sum +++ b/instrumentation/github.com/gocql/gocql/otelgocql/test/go.sum @@ -32,8 +32,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/test/gocql_test.go b/instrumentation/github.com/gocql/gocql/otelgocql/test/gocql_test.go index 5f4e4530ee7..91182114a75 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/test/gocql_test.go +++ b/instrumentation/github.com/gocql/gocql/otelgocql/test/gocql_test.go @@ -36,7 +36,7 @@ import ( "go.opentelemetry.io/otel/sdk/metric/metricdata" 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.17.0" "go.opentelemetry.io/otel/trace" ) @@ -211,7 +211,7 @@ func TestConnection(t *testing.T) { func TestHostOrIP(t *testing.T) { hostAndPort := "127.0.0.1:9042" attr := internal.HostOrIP(hostAndPort) - assert.Equal(t, semconv.NetPeerIPKey, attr.Key) + assert.Equal(t, semconv.NetSockPeerAddrKey, attr.Key) assert.Equal(t, "127.0.0.1", attr.Value.AsString()) hostAndPort = "exampleHost:9042" @@ -227,7 +227,7 @@ func TestHostOrIP(t *testing.T) { func assertConnectionLevelAttributes(t *testing.T, span sdktrace.ReadOnlySpan) { attrs := span.Attributes() assert.Contains(t, attrs, semconv.DBSystemCassandra) - assert.Contains(t, attrs, semconv.NetPeerIPKey.String("127.0.0.1")) + assert.Contains(t, attrs, semconv.NetSockPeerAddrKey.String("127.0.0.1")) assert.Contains(t, attrs, semconv.NetPeerPortKey.Int64(9042)) assert.Contains(t, attrs, internal.CassHostStateKey.String("UP")) assert.Equal(t, trace.SpanKindClient, span.SpanKind()) diff --git a/instrumentation/github.com/gorilla/mux/otelmux/example/go.mod b/instrumentation/github.com/gorilla/mux/otelmux/example/go.mod index e589648ff31..73760c0ae14 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/example/go.mod +++ b/instrumentation/github.com/gorilla/mux/otelmux/example/go.mod @@ -7,7 +7,7 @@ replace go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelm require ( github.com/gorilla/mux v1.8.0 go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/github.com/gorilla/mux/otelmux/example/go.sum b/instrumentation/github.com/gorilla/mux/otelmux/example/go.sum index fe8a2195f65..18a6bb88d39 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/example/go.sum +++ b/instrumentation/github.com/gorilla/mux/otelmux/example/go.sum @@ -11,8 +11,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/gorilla/mux/otelmux/go.mod b/instrumentation/github.com/gorilla/mux/otelmux/go.mod index 099f228366d..cd6234e66e0 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/go.mod +++ b/instrumentation/github.com/gorilla/mux/otelmux/go.mod @@ -6,7 +6,7 @@ require ( github.com/felixge/httpsnoop v1.0.3 github.com/gorilla/mux v1.8.0 github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/gorilla/mux/otelmux/go.sum b/instrumentation/github.com/gorilla/mux/otelmux/go.sum index a5d16bfa31c..e7c8a905ae2 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/go.sum +++ b/instrumentation/github.com/gorilla/mux/otelmux/go.sum @@ -20,8 +20,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/gorilla/mux/otelmux/mux.go b/instrumentation/github.com/gorilla/mux/otelmux/mux.go index 03fbd02f26f..d89f0f5834b 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/mux.go +++ b/instrumentation/github.com/gorilla/mux/otelmux/mux.go @@ -25,7 +25,8 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + "go.opentelemetry.io/otel/semconv/v1.13.0/httpconv" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -135,15 +136,20 @@ func (tw traceware) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } } - if routeStr == "" { - routeStr = fmt.Sprintf("HTTP %s route not found", r.Method) - } opts := []oteltrace.SpanStartOption{ - oteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", r)...), - oteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(r)...), - oteltrace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(tw.service, routeStr, r)...), + oteltrace.WithAttributes(httpconv.ServerRequest(r)...), + // TODO: pass service to ServerRequest when + // https://github.com/open-telemetry/opentelemetry-go/pull/3619 is + // merged, and remove this. + oteltrace.WithAttributes(semconv.NetHostNameKey.String(tw.service)), oteltrace.WithSpanKind(oteltrace.SpanKindServer), } + if routeStr == "" { + routeStr = fmt.Sprintf("HTTP %s route not found", r.Method) + } else { + rAttr := semconv.HTTPRouteKey.String(routeStr) + opts = append(opts, oteltrace.WithAttributes(rAttr)) + } spanName := tw.spanNameFormatter(routeStr, r) ctx, span := tw.tracer.Start(ctx, spanName, opts...) defer span.End() @@ -151,8 +157,11 @@ func (tw traceware) ServeHTTP(w http.ResponseWriter, r *http.Request) { rrw := getRRW(w) defer putRRW(rrw) tw.handler.ServeHTTP(rrw.writer, r2) - attrs := semconv.HTTPAttributesFromHTTPStatusCode(rrw.status) - spanStatus, spanMessage := semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(rrw.status, oteltrace.SpanKindServer) - span.SetAttributes(attrs...) - span.SetStatus(spanStatus, spanMessage) + if rrw.status > 0 { + span.SetAttributes(semconv.HTTPStatusCodeKey.Int(rrw.status)) + } + span.SetStatus(httpconv.ServerStatus(rrw.status)) + if rrw.status > 0 { + span.SetAttributes(semconv.HTTPStatusCodeKey.Int(rrw.status)) + } } diff --git a/instrumentation/github.com/gorilla/mux/otelmux/test/go.mod b/instrumentation/github.com/gorilla/mux/otelmux/test/go.mod index 6462c4e8127..d5cf9be8566 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/test/go.mod +++ b/instrumentation/github.com/gorilla/mux/otelmux/test/go.mod @@ -6,7 +6,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/gorilla/mux/otelmux/test/go.sum b/instrumentation/github.com/gorilla/mux/otelmux/test/go.sum index a5d16bfa31c..e7c8a905ae2 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/test/go.sum +++ b/instrumentation/github.com/gorilla/mux/otelmux/test/go.sum @@ -20,8 +20,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/github.com/gorilla/mux/otelmux/test/mux_test.go b/instrumentation/github.com/gorilla/mux/otelmux/test/mux_test.go index ae1a5d53919..1b14d8628cb 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/test/mux_test.go +++ b/instrumentation/github.com/gorilla/mux/otelmux/test/mux_test.go @@ -56,7 +56,7 @@ func TestSDKIntegration(t *testing.T) { assertSpan(t, sr.Ended()[0], "/user/{id:[0-9]+}", trace.SpanKindServer, - attribute.String("http.server_name", "foobar"), + attribute.String("net.host.name", "foobar"), attribute.Int("http.status_code", http.StatusOK), attribute.String("http.method", "GET"), attribute.String("http.target", "/user/123"), @@ -65,7 +65,7 @@ func TestSDKIntegration(t *testing.T) { assertSpan(t, sr.Ended()[1], "/book/{title}", trace.SpanKindServer, - attribute.String("http.server_name", "foobar"), + attribute.String("net.host.name", "foobar"), attribute.Int("http.status_code", http.StatusOK), attribute.String("http.method", "GET"), attribute.String("http.target", "/book/foo"), @@ -90,7 +90,7 @@ func TestNotFoundIsNotError(t *testing.T) { assertSpan(t, sr.Ended()[0], "/does/not/exist", trace.SpanKindServer, - attribute.String("http.server_name", "foobar"), + attribute.String("net.host.name", "foobar"), attribute.Int("http.status_code", http.StatusNotFound), attribute.String("http.method", "GET"), attribute.String("http.target", "/does/not/exist"), diff --git a/instrumentation/github.com/labstack/echo/otelecho/echo.go b/instrumentation/github.com/labstack/echo/otelecho/echo.go index e33c6487318..8817d8209e3 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/echo.go +++ b/instrumentation/github.com/labstack/echo/otelecho/echo.go @@ -24,7 +24,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -69,11 +70,17 @@ func Middleware(service string, opts ...Option) echo.MiddlewareFunc { }() ctx := cfg.Propagators.Extract(savedCtx, propagation.HeaderCarrier(request.Header)) opts := []oteltrace.SpanStartOption{ - oteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", request)...), - oteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(request)...), - oteltrace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(service, c.Path(), request)...), + oteltrace.WithAttributes(httpconv.ServerRequest(request)...), + // TODO: pass service to ServerRequest when + // https://github.com/open-telemetry/opentelemetry-go/pull/3619 is + // merged, and remove this. + oteltrace.WithAttributes(semconv.NetHostNameKey.String(service)), oteltrace.WithSpanKind(oteltrace.SpanKindServer), } + if path := c.Path(); path != "" { + rAttr := semconv.HTTPRouteKey.String(path) + opts = append(opts, oteltrace.WithAttributes(rAttr)) + } spanName := c.Path() if spanName == "" { spanName = fmt.Sprintf("HTTP %s route not found", request.Method) @@ -93,10 +100,11 @@ func Middleware(service string, opts ...Option) echo.MiddlewareFunc { c.Error(err) } - attrs := semconv.HTTPAttributesFromHTTPStatusCode(c.Response().Status) - spanStatus, spanMessage := semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(c.Response().Status, oteltrace.SpanKindServer) - span.SetAttributes(attrs...) - span.SetStatus(spanStatus, spanMessage) + status := c.Response().Status + span.SetStatus(httpconv.ServerStatus(status)) + if status > 0 { + span.SetAttributes(semconv.HTTPStatusCodeKey.Int(status)) + } return nil } diff --git a/instrumentation/github.com/labstack/echo/otelecho/example/go.mod b/instrumentation/github.com/labstack/echo/otelecho/example/go.mod index 66286b21357..564a140df13 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/example/go.mod +++ b/instrumentation/github.com/labstack/echo/otelecho/example/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/labstack/echo/v4 v4.10.0 go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/github.com/labstack/echo/otelecho/example/go.sum b/instrumentation/github.com/labstack/echo/otelecho/example/go.sum index a364930e46c..b2a782be421 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/example/go.sum +++ b/instrumentation/github.com/labstack/echo/otelecho/example/go.sum @@ -29,8 +29,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/github.com/labstack/echo/otelecho/go.mod b/instrumentation/github.com/labstack/echo/otelecho/go.mod index 3e8df2f912c..21ed49bb23d 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/go.mod +++ b/instrumentation/github.com/labstack/echo/otelecho/go.mod @@ -8,7 +8,7 @@ require ( github.com/labstack/echo/v4 v4.10.0 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/propagators/b3 v1.12.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/labstack/echo/otelecho/go.sum b/instrumentation/github.com/labstack/echo/otelecho/go.sum index 75faf5b14bc..749da091b6c 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/go.sum +++ b/instrumentation/github.com/labstack/echo/otelecho/go.sum @@ -34,8 +34,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= golang.org/x/crypto v0.2.0 h1:BRXPfhNivWL5Yq0BGQ39a2sW6t44aODpfxkWjYdzewE= diff --git a/instrumentation/github.com/labstack/echo/otelecho/test/echo_test.go b/instrumentation/github.com/labstack/echo/otelecho/test/echo_test.go index 489647e2a81..18cec8ea22d 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/test/echo_test.go +++ b/instrumentation/github.com/labstack/echo/otelecho/test/echo_test.go @@ -100,7 +100,7 @@ func TestTrace200(t *testing.T) { assert.Equal(t, "/user/:id", span.Name()) assert.Equal(t, oteltrace.SpanKindServer, span.SpanKind()) attrs := span.Attributes() - assert.Contains(t, attrs, attribute.String("http.server_name", "foobar")) + assert.Contains(t, attrs, attribute.String("net.host.name", "foobar")) assert.Contains(t, attrs, attribute.Int("http.status_code", http.StatusOK)) assert.Contains(t, attrs, attribute.String("http.method", "GET")) assert.Contains(t, attrs, attribute.String("http.target", "/user/123")) @@ -132,7 +132,7 @@ func TestError(t *testing.T) { span := spans[0] assert.Equal(t, "/server_err", span.Name()) attrs := span.Attributes() - assert.Contains(t, attrs, attribute.String("http.server_name", "foobar")) + assert.Contains(t, attrs, attribute.String("net.host.name", "foobar")) assert.Contains(t, attrs, attribute.Int("http.status_code", http.StatusInternalServerError)) assert.Contains(t, attrs, attribute.String("echo.error", "oh no")) // server errors set the status diff --git a/instrumentation/github.com/labstack/echo/otelecho/test/go.mod b/instrumentation/github.com/labstack/echo/otelecho/test/go.mod index af194feddc6..e8f43b358cd 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/test/go.mod +++ b/instrumentation/github.com/labstack/echo/otelecho/test/go.mod @@ -6,7 +6,7 @@ require ( github.com/labstack/echo/v4 v4.10.0 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/github.com/labstack/echo/otelecho/test/go.sum b/instrumentation/github.com/labstack/echo/otelecho/test/go.sum index 6caee8712b1..ef07002992e 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/test/go.sum +++ b/instrumentation/github.com/labstack/echo/otelecho/test/go.sum @@ -34,8 +34,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.mod b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.mod index dfe988b6ff5..830621007e3 100644 --- a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.mod +++ b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( go.mongodb.org/mongo-driver v1.11.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.sum b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.sum index 040eb1fb6e3..6b1bca6e5e2 100644 --- a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.sum +++ b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.sum @@ -38,8 +38,8 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= go.mongodb.org/mongo-driver v1.11.1 h1:QP0znIRTuL0jf1oBQoAoM0C6ZJfBK4kx0Uumtv1A7w8= go.mongodb.org/mongo-driver v1.11.1/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= diff --git a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/mongo.go b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/mongo.go index 5b1cadc6618..5cde004266e 100644 --- a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/mongo.go +++ b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/mongo.go @@ -23,7 +23,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" "go.mongodb.org/mongo-driver/bson" diff --git a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/go.mod b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/go.mod index 497c51ca8f6..3705a7f31b5 100644 --- a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/go.mod +++ b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/go.mod @@ -7,7 +7,7 @@ require ( go.mongodb.org/mongo-driver v1.11.1 go.opentelemetry.io/contrib v1.12.0 go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/go.sum b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/go.sum index 86ff7bf71ba..9ab61d65af6 100644 --- a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/go.sum +++ b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/go.sum @@ -43,8 +43,8 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= go.mongodb.org/mongo-driver v1.11.1 h1:QP0znIRTuL0jf1oBQoAoM0C6ZJfBK4kx0Uumtv1A7w8= go.mongodb.org/mongo-driver v1.11.1/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/config.go b/instrumentation/google.golang.org/grpc/otelgrpc/config.go index 369ebae24a5..50e03372685 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/config.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/config.go @@ -23,7 +23,7 @@ import ( "go.opentelemetry.io/otel/metric/instrument/syncint64" "go.opentelemetry.io/otel/metric/unit" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/example/go.mod b/instrumentation/google.golang.org/grpc/otelgrpc/example/go.mod index 348dd737cb3..879d3525b90 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/example/go.mod +++ b/instrumentation/google.golang.org/grpc/otelgrpc/example/go.mod @@ -7,7 +7,7 @@ replace go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelg require ( github.com/golang/protobuf v1.5.2 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/example/go.sum b/instrumentation/google.golang.org/grpc/otelgrpc/example/go.sum index ed3ee5f44b2..7bd7e1ceb7d 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/example/go.sum +++ b/instrumentation/google.golang.org/grpc/otelgrpc/example/go.sum @@ -14,8 +14,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/go.mod b/instrumentation/google.golang.org/grpc/otelgrpc/go.mod index 777862bb14f..53142deb241 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/go.mod +++ b/instrumentation/google.golang.org/grpc/otelgrpc/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/metric v0.34.0 go.opentelemetry.io/otel/trace v1.11.2 google.golang.org/grpc v1.52.0 diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/go.sum b/instrumentation/google.golang.org/grpc/otelgrpc/go.sum index e2375ee5fe6..73e4c3c6454 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/go.sum +++ b/instrumentation/google.golang.org/grpc/otelgrpc/go.sum @@ -25,8 +25,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go index 339e3d140ff..5cb8c915711 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go @@ -20,6 +20,7 @@ import ( "context" "io" "net" + "strconv" "time" "google.golang.org/grpc" @@ -32,7 +33,7 @@ import ( "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) @@ -456,7 +457,7 @@ func spanInfo(fullMethod, peerAddress string) (string, []attribute.KeyValue) { // peerAttr returns attributes about the peer address. func peerAttr(addr string) []attribute.KeyValue { - host, port, err := net.SplitHostPort(addr) + host, p, err := net.SplitHostPort(addr) if err != nil { return []attribute.KeyValue(nil) } @@ -464,11 +465,25 @@ func peerAttr(addr string) []attribute.KeyValue { if host == "" { host = "127.0.0.1" } + port, err := strconv.Atoi(p) + if err != nil { + return []attribute.KeyValue(nil) + } - return []attribute.KeyValue{ - semconv.NetPeerIPKey.String(host), - semconv.NetPeerPortKey.String(port), + var attr []attribute.KeyValue + if ip := net.ParseIP(host); ip != nil { + attr = []attribute.KeyValue{ + semconv.NetSockPeerAddrKey.String(host), + semconv.NetSockPeerPortKey.Int(port), + } + } else { + attr = []attribute.KeyValue{ + semconv.NetPeerNameKey.String(host), + semconv.NetPeerPortKey.Int(port), + } } + + return attr } // peerFromCtx returns a peer address from a context, if one exists. diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go b/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go index bc214d363a2..27588b5f7a7 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go @@ -18,7 +18,7 @@ import ( "strings" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) // ParseFullMethod returns a span name following the OpenTelemetry semantic diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go b/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go index 611c7f3017a..b92652e119f 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go @@ -16,7 +16,7 @@ package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.g import ( "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) // Semantic conventions for attribute keys for gRPC. diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/test/go.mod b/instrumentation/google.golang.org/grpc/otelgrpc/test/go.mod index 6b37b82948f..8d9c8b14d90 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/test/go.mod +++ b/instrumentation/google.golang.org/grpc/otelgrpc/test/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/sdk/metric v0.34.0 go.uber.org/goleak v1.2.0 diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/test/go.sum b/instrumentation/google.golang.org/grpc/otelgrpc/test/go.sum index 2bc2225a24c..8681bca7fde 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/test/go.sum +++ b/instrumentation/google.golang.org/grpc/otelgrpc/test/go.sum @@ -29,8 +29,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go b/instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go index b6154ef5080..374f1d6013a 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go @@ -34,7 +34,7 @@ import ( "go.opentelemetry.io/otel/sdk/metric/metricdata" "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.17.0" ) const bufSize = 2048 diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go b/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go index ca03eb679b3..dbb3789cf0f 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go @@ -28,7 +28,7 @@ import ( "go.opentelemetry.io/otel/codes" "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.17.0" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -66,7 +66,7 @@ func (mcuici *mockUICInvoker) invoker(ctx context.Context, method string, req, r } func TestUnaryClientInterceptor(t *testing.T) { - clientConn, err := grpc.Dial("fake:connection", grpc.WithTransportCredentials(insecure.NewCredentials())) + clientConn, err := grpc.Dial("fake:8906", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatalf("failed to create client connection: %v", err) } @@ -96,8 +96,8 @@ func TestUnaryClientInterceptor(t *testing.T) { semconv.RPCServiceKey.String("github.com.serviceName"), semconv.RPCMethodKey.String("bar"), otelgrpc.GRPCStatusCodeKey.Int64(0), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), }, eventsAttr: []map[attribute.Key]attribute.Value{ { @@ -118,8 +118,8 @@ func TestUnaryClientInterceptor(t *testing.T) { semconv.RPCServiceKey.String("serviceName"), semconv.RPCMethodKey.String("bar"), otelgrpc.GRPCStatusCodeKey.Int64(0), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), }, eventsAttr: []map[attribute.Key]attribute.Value{ { @@ -140,8 +140,8 @@ func TestUnaryClientInterceptor(t *testing.T) { semconv.RPCServiceKey.String("serviceName"), semconv.RPCMethodKey.String("bar"), otelgrpc.GRPCStatusCodeKey.Int64(int64(grpc_codes.OK)), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), }, eventsAttr: []map[attribute.Key]attribute.Value{ { @@ -163,8 +163,8 @@ func TestUnaryClientInterceptor(t *testing.T) { semconv.RPCServiceKey.String("serviceName"), semconv.RPCMethodKey.String("bar_error"), otelgrpc.GRPCStatusCodeKey.Int64(int64(grpc_codes.Internal)), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), }, eventsAttr: []map[attribute.Key]attribute.Value{ { @@ -184,8 +184,8 @@ func TestUnaryClientInterceptor(t *testing.T) { expectedAttr: []attribute.KeyValue{ semconv.RPCSystemKey.String("grpc"), otelgrpc.GRPCStatusCodeKey.Int64(0), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), }, eventsAttr: []map[attribute.Key]attribute.Value{ { @@ -206,8 +206,8 @@ func TestUnaryClientInterceptor(t *testing.T) { otelgrpc.GRPCStatusCodeKey.Int64(0), semconv.RPCServiceKey.String("github.com.foo.serviceName_123"), semconv.RPCMethodKey.String("method"), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), }, eventsAttr: []map[attribute.Key]attribute.Value{ { @@ -284,7 +284,7 @@ func newMockClientStream(opts clientStreamOpts) *mockClientStream { func createInterceptedStreamClient(t *testing.T, method string, opts clientStreamOpts) (grpc.ClientStream, *tracetest.SpanRecorder) { mockStream := newMockClientStream(opts) - clientConn, err := grpc.Dial("fake:connection", grpc.WithTransportCredentials(insecure.NewCredentials())) + clientConn, err := grpc.Dial("fake:8906", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatalf("failed to create client connection: %v", err) } @@ -352,8 +352,8 @@ func TestStreamClientInterceptorOnBIDIStream(t *testing.T) { otelgrpc.GRPCStatusCodeKey.Int64(int64(grpc_codes.OK)), semconv.RPCServiceKey.String("github.com.serviceName"), semconv.RPCMethodKey.String("bar"), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), } assert.ElementsMatch(t, expectedAttr, span.Attributes()) @@ -420,8 +420,8 @@ func TestStreamClientInterceptorOnUnidirectionalClientServerStream(t *testing.T) otelgrpc.GRPCStatusCodeKey.Int64(int64(grpc_codes.OK)), semconv.RPCServiceKey.String("github.com.serviceName"), semconv.RPCMethodKey.String("bar"), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), } assert.ElementsMatch(t, expectedAttr, span.Attributes()) @@ -449,7 +449,7 @@ func TestStreamClientInterceptorOnUnidirectionalClientServerStream(t *testing.T) // There should be no goleaks. func TestStreamClientInterceptorCancelContext(t *testing.T) { defer goleak.VerifyNone(t) - clientConn, err := grpc.Dial("fake:connection", grpc.WithTransportCredentials(insecure.NewCredentials())) + clientConn, err := grpc.Dial("fake:8906", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatalf("failed to create client connection: %v", err) } @@ -502,7 +502,7 @@ func TestStreamClientInterceptorCancelContext(t *testing.T) { func TestStreamClientInterceptorWithError(t *testing.T) { defer goleak.VerifyNone(t) - clientConn, err := grpc.Dial("fake:connection", grpc.WithTransportCredentials(insecure.NewCredentials())) + clientConn, err := grpc.Dial("fake:8906", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatalf("failed to create client connection: %v", err) } @@ -542,8 +542,8 @@ func TestStreamClientInterceptorWithError(t *testing.T) { otelgrpc.GRPCStatusCodeKey.Int64(int64(grpc_codes.Unknown)), semconv.RPCServiceKey.String("github.com.serviceName"), semconv.RPCMethodKey.String("bar"), - semconv.NetPeerIPKey.String("fake"), - semconv.NetPeerPortKey.String("connection"), + semconv.NetPeerNameKey.String("fake"), + semconv.NetPeerPortKey.Int(8906), } assert.ElementsMatch(t, expectedAttr, span.Attributes()) assert.Equal(t, codes.Error, span.Status().Code) diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.mod b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.mod index a9932ba4ea3..feddbcb3856 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.mod +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.mod @@ -9,7 +9,7 @@ replace ( require ( go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.sum b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.sum index 2f0f999c45c..f11965a7edf 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.sum +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.sum @@ -25,8 +25,8 @@ github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:s github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e h1:GSGeB9EAKY2spCABz6xOX5DbxZEXolK+nBSvmsQwRjM= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.mod b/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.mod index d6fd68f5e6b..6946fc7ac51 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.mod +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.mod @@ -7,7 +7,7 @@ replace go.opentelemetry.io/contrib/propagators/b3 => ../../../../propagators/b3 require ( github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/propagators/b3 v1.12.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 gopkg.in/macaron.v1 v1.4.0 ) diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.sum b/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.sum index 9b26b58d16e..8b40d980df5 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.sum +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.sum @@ -34,8 +34,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e h1:GSGeB9EAKY2spCABz6xOX5DbxZEXolK+nBSvmsQwRjM= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron.go b/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron.go index 53ec6c1a7bb..afddb40b7c2 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron.go +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron.go @@ -21,7 +21,8 @@ import ( "gopkg.in/macaron.v1" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + "go.opentelemetry.io/otel/semconv/v1.13.0/httpconv" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -43,9 +44,11 @@ func Middleware(service string, opts ...Option) macaron.Handler { ctx := cfg.Propagators.Extract(savedCtx, propagation.HeaderCarrier(c.Req.Header)) opts := []oteltrace.SpanStartOption{ - oteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", c.Req.Request)...), - oteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(c.Req.Request)...), - oteltrace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(service, "", c.Req.Request)...), + oteltrace.WithAttributes(httpconv.ServerRequest(c.Req.Request)...), + // TODO: pass service to ServerRequest when + // https://github.com/open-telemetry/opentelemetry-go/pull/3619 is + // merged, and remove this. + oteltrace.WithAttributes(semconv.NetHostNameKey.String(service)), oteltrace.WithSpanKind(oteltrace.SpanKindServer), } // TODO: span name should be router template not the actual request path, eg /user/:id vs /user/123 @@ -63,9 +66,9 @@ func Middleware(service string, opts ...Option) macaron.Handler { c.Next() status := c.Resp.Status() - attrs := semconv.HTTPAttributesFromHTTPStatusCode(status) - spanStatus, spanMessage := semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(status, oteltrace.SpanKindServer) - span.SetAttributes(attrs...) - span.SetStatus(spanStatus, spanMessage) + span.SetStatus(httpconv.ServerStatus(status)) + if status > 0 { + span.SetAttributes(semconv.HTTPStatusCodeKey.Int(status)) + } } } diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/go.mod b/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/go.mod index 2fc4e24f18d..6be53d778de 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/go.mod +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 gopkg.in/macaron.v1 v1.4.0 diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/go.sum b/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/go.sum index f5ce835478c..dc4ba1948ab 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/go.sum +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/go.sum @@ -34,8 +34,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e h1:GSGeB9EAKY2spCABz6xOX5DbxZEXolK+nBSvmsQwRjM= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/macaron_test.go b/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/macaron_test.go index 21a92949fee..6f16922fa55 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/macaron_test.go +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/test/macaron_test.go @@ -82,7 +82,7 @@ func TestChildSpanNames(t *testing.T) { assert.Equal(t, "/user/123", span.Name()) // TODO: span name should show router template, eg /user/:id assert.Equal(t, oteltrace.SpanKindServer, span.SpanKind()) attrs := span.Attributes() - assert.Contains(t, attrs, attribute.String("http.server_name", "foobar")) + assert.Contains(t, attrs, attribute.String("net.host.name", "foobar")) assert.Contains(t, attrs, attribute.Int("http.status_code", http.StatusOK)) assert.Contains(t, attrs, attribute.String("http.method", "GET")) assert.Contains(t, attrs, attribute.String("http.target", "/user/123")) @@ -91,7 +91,7 @@ func TestChildSpanNames(t *testing.T) { assert.Equal(t, "/book/foo", span.Name()) // TODO: span name should show router template, eg /book/:title assert.Equal(t, oteltrace.SpanKindServer, span.SpanKind()) attrs = span.Attributes() - assert.Contains(t, attrs, attribute.String("http.server_name", "foobar")) + assert.Contains(t, attrs, attribute.String("net.host.name", "foobar")) assert.Contains(t, attrs, attribute.Int("http.status_code", http.StatusOK)) assert.Contains(t, attrs, attribute.String("http.method", "GET")) assert.Contains(t, attrs, attribute.String("http.target", "/book/foo")) diff --git a/instrumentation/host/example/go.mod b/instrumentation/host/example/go.mod index a0d86614d6c..d3290f1343f 100644 --- a/instrumentation/host/example/go.mod +++ b/instrumentation/host/example/go.mod @@ -6,7 +6,7 @@ replace go.opentelemetry.io/contrib/instrumentation/host => ../ require ( go.opentelemetry.io/contrib/instrumentation/host v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/sdk/metric v0.34.0 diff --git a/instrumentation/host/example/go.sum b/instrumentation/host/example/go.sum index 227a081d4fd..da2585bebca 100644 --- a/instrumentation/host/example/go.sum +++ b/instrumentation/host/example/go.sum @@ -32,8 +32,8 @@ github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYm github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0 h1:O1E9/qhspQSz3O6/dSGLNBND2TO9mUaSvlhcKJMv278= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0/go.mod h1:Id0oYi2ARij/um3gFV+t5rH1MTFdJpfTimsFsqKS7pE= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= diff --git a/instrumentation/host/example/main.go b/instrumentation/host/example/main.go index 42d4f879216..3f8665b97f3 100644 --- a/instrumentation/host/example/main.go +++ b/instrumentation/host/example/main.go @@ -28,7 +28,7 @@ import ( "go.opentelemetry.io/otel/exporters/stdout/stdoutmetric" "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.11.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) var res = resource.NewWithAttributes( diff --git a/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go b/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go index 2bf74b5d4c9..249f53d49b2 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go @@ -25,7 +25,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) @@ -272,7 +272,7 @@ func (ct *clientTracer) span(hook string) trace.Span { } func (ct *clientTracer) getConn(host string) { - ct.start("http.getconn", "http.getconn", semconv.HTTPHostKey.String(host)) + ct.start("http.getconn", "http.getconn", semconv.NetHostNameKey.String(host)) } func (ct *clientTracer) gotConn(info httptrace.GotConnInfo) { @@ -297,7 +297,7 @@ func (ct *clientTracer) gotFirstResponseByte() { } func (ct *clientTracer) dnsStart(info httptrace.DNSStartInfo) { - ct.start("http.dns", "http.dns", semconv.HTTPHostKey.String(info.Host)) + ct.start("http.dns", "http.dns", semconv.NetHostNameKey.String(info.Host)) } func (ct *clientTracer) dnsDone(info httptrace.DNSDoneInfo) { diff --git a/instrumentation/net/http/httptrace/otelhttptrace/example/client/client.go b/instrumentation/net/http/httptrace/otelhttptrace/example/client/client.go index d4b5a472bcc..53535fe9070 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/example/client/client.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/example/client/client.go @@ -32,7 +32,7 @@ import ( stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" "go.opentelemetry.io/otel/propagation" sdktrace "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/net/http/httptrace/otelhttptrace/example/go.mod b/instrumentation/net/http/httptrace/otelhttptrace/example/go.mod index 7e8e44837e5..81cd03bc2ab 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/example/go.mod +++ b/instrumentation/net/http/httptrace/otelhttptrace/example/go.mod @@ -10,7 +10,7 @@ replace ( require ( go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.37.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/net/http/httptrace/otelhttptrace/example/go.sum b/instrumentation/net/http/httptrace/otelhttptrace/example/go.sum index 70f5b6624b6..3f6d86b0202 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/example/go.sum +++ b/instrumentation/net/http/httptrace/otelhttptrace/example/go.sum @@ -9,8 +9,8 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2/go.mod h1:bx//lU66dPzNT+Y0hHA12ciKoMOH9iixEwCqC1OeQWQ= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= diff --git a/instrumentation/net/http/httptrace/otelhttptrace/example/server/server.go b/instrumentation/net/http/httptrace/otelhttptrace/example/server/server.go index a76fdeb2dd1..911bff9bcff 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/example/server/server.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/example/server/server.go @@ -29,7 +29,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.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/net/http/httptrace/otelhttptrace/go.mod b/instrumentation/net/http/httptrace/otelhttptrace/go.mod index 1e7060d860b..b1c5d58143a 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/go.mod +++ b/instrumentation/net/http/httptrace/otelhttptrace/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/google/go-cmp v0.5.9 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/net/http/httptrace/otelhttptrace/go.sum b/instrumentation/net/http/httptrace/otelhttptrace/go.sum index e27df864302..6589f04bdcc 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/go.sum +++ b/instrumentation/net/http/httptrace/otelhttptrace/go.sum @@ -8,8 +8,8 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/instrumentation/net/http/httptrace/otelhttptrace/httptrace.go b/instrumentation/net/http/httptrace/otelhttptrace/httptrace.go index 42bfccbaeda..bf18392aefc 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/httptrace.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/httptrace.go @@ -22,7 +22,9 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/baggage" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.13.0" + "go.opentelemetry.io/otel/semconv/v1.13.0/httpconv" + "go.opentelemetry.io/otel/semconv/v1.13.0/netconv" "go.opentelemetry.io/otel/trace" ) @@ -64,11 +66,11 @@ func Extract(ctx context.Context, req *http.Request, opts ...Option) ([]attribut c := newConfig(opts) ctx = c.propagators.Extract(ctx, propagation.HeaderCarrier(req.Header)) - attrs := append( - semconv.HTTPServerAttributesFromHTTPRequest("", "", req), - semconv.NetAttributesFromHTTPRequest("tcp", req)..., - ) - + attrs := append(httpconv.ServerRequest(req), netconv.Transport("tcp")) + if req.ContentLength > 0 { + a := semconv.HTTPRequestContentLengthKey.Int(int(req.ContentLength)) + attrs = append(attrs, a) + } return attrs, baggage.FromContext(ctx), trace.SpanContextFromContext(ctx) } diff --git a/instrumentation/net/http/httptrace/otelhttptrace/httptrace_test.go b/instrumentation/net/http/httptrace/otelhttptrace/httptrace_test.go index f3b5adc0073..400d33c93f6 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/httptrace_test.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/httptrace_test.go @@ -27,7 +27,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/baggage" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) @@ -46,7 +46,7 @@ func TestRoundtrip(t *testing.T) { actualAttrs := make(map[attribute.Key]string) for _, attr := range attrs { - if attr.Key == semconv.NetPeerPortKey { + if attr.Key == semconv.NetSockPeerPortKey { // Peer port will be non-deterministic continue } @@ -82,15 +82,14 @@ func TestRoundtrip(t *testing.T) { hp := strings.Split(address.String(), ":") expectedAttrs = map[attribute.Key]string{ semconv.HTTPFlavorKey: "1.1", - semconv.HTTPHostKey: address.String(), + semconv.NetHostNameKey: hp[0], + semconv.NetHostPortKey: hp[1], semconv.HTTPMethodKey: "GET", semconv.HTTPSchemeKey: "http", semconv.HTTPTargetKey: "/", semconv.HTTPUserAgentKey: "Go-http-client/1.1", semconv.HTTPRequestContentLengthKey: "3", - semconv.NetHostIPKey: hp[0], - semconv.NetHostPortKey: hp[1], - semconv.NetPeerIPKey: "127.0.0.1", + semconv.NetSockPeerAddrKey: hp[0], semconv.NetTransportKey: "ip_tcp", } diff --git a/instrumentation/net/http/httptrace/otelhttptrace/test/go.mod b/instrumentation/net/http/httptrace/otelhttptrace/test/go.mod index b4472134f36..921cd316f67 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/test/go.mod +++ b/instrumentation/net/http/httptrace/otelhttptrace/test/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/instrumentation/net/http/httptrace/otelhttptrace/test/go.sum b/instrumentation/net/http/httptrace/otelhttptrace/test/go.sum index 90b60c12543..e0f1ffa78ff 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/test/go.sum +++ b/instrumentation/net/http/httptrace/otelhttptrace/test/go.sum @@ -16,8 +16,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/net/http/otelhttp/config.go b/instrumentation/net/http/otelhttp/config.go index d0337f3a5e4..0c3e48d5583 100644 --- a/instrumentation/net/http/otelhttp/config.go +++ b/instrumentation/net/http/otelhttp/config.go @@ -33,6 +33,7 @@ const ( // config represents the configuration options available for the http.Handler // and http.Transport types. type config struct { + ServerName string Tracer trace.Tracer Meter metric.Meter Propagators propagation.TextMapPropagator @@ -198,3 +199,11 @@ func WithClientTrace(f func(context.Context) *httptrace.ClientTrace) Option { c.ClientTrace = f }) } + +// WithServerName returns an Option that sets the name of the (virtual) server +// handling requests. +func WithServerName(server string) Option { + return optionFunc(func(c *config) { + c.ServerName = server + }) +} diff --git a/instrumentation/net/http/otelhttp/example/client/client.go b/instrumentation/net/http/otelhttp/example/client/client.go index 5e2bc59e151..f01c8e8fec8 100644 --- a/instrumentation/net/http/otelhttp/example/client/client.go +++ b/instrumentation/net/http/otelhttp/example/client/client.go @@ -30,7 +30,7 @@ import ( stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" "go.opentelemetry.io/otel/propagation" sdktrace "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/net/http/otelhttp/example/go.mod b/instrumentation/net/http/otelhttp/example/go.mod index 6b730b7f627..8cf32ef7361 100644 --- a/instrumentation/net/http/otelhttp/example/go.mod +++ b/instrumentation/net/http/otelhttp/example/go.mod @@ -6,7 +6,7 @@ replace go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp => ../ require ( go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/metric v0.34.0 diff --git a/instrumentation/net/http/otelhttp/example/go.sum b/instrumentation/net/http/otelhttp/example/go.sum index 57f809c51ea..04f1e2f3bb9 100644 --- a/instrumentation/net/http/otelhttp/example/go.sum +++ b/instrumentation/net/http/otelhttp/example/go.sum @@ -9,8 +9,8 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0 h1:O1E9/qhspQSz3O6/dSGLNBND2TO9mUaSvlhcKJMv278= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0/go.mod h1:Id0oYi2ARij/um3gFV+t5rH1MTFdJpfTimsFsqKS7pE= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU= diff --git a/instrumentation/net/http/otelhttp/example/server/server.go b/instrumentation/net/http/otelhttp/example/server/server.go index 2dbabc63477..ec210dd2099 100644 --- a/instrumentation/net/http/otelhttp/example/server/server.go +++ b/instrumentation/net/http/otelhttp/example/server/server.go @@ -33,7 +33,7 @@ import ( sdkmetric "go.opentelemetry.io/otel/sdk/metric" "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.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/net/http/otelhttp/go.mod b/instrumentation/net/http/otelhttp/go.mod index 2cc7015428b..698258b4c78 100644 --- a/instrumentation/net/http/otelhttp/go.mod +++ b/instrumentation/net/http/otelhttp/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/felixge/httpsnoop v1.0.3 github.com/stretchr/testify v1.8.1 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/metric v0.34.0 go.opentelemetry.io/otel/trace v1.11.2 ) diff --git a/instrumentation/net/http/otelhttp/go.sum b/instrumentation/net/http/otelhttp/go.sum index 2c3cda20fbb..5a80131cec4 100644 --- a/instrumentation/net/http/otelhttp/go.sum +++ b/instrumentation/net/http/otelhttp/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= diff --git a/instrumentation/net/http/otelhttp/handler.go b/instrumentation/net/http/otelhttp/handler.go index fd91e4162da..120aa875f2a 100644 --- a/instrumentation/net/http/otelhttp/handler.go +++ b/instrumentation/net/http/otelhttp/handler.go @@ -27,7 +27,8 @@ import ( "go.opentelemetry.io/otel/metric/instrument/syncfloat64" "go.opentelemetry.io/otel/metric/instrument/syncint64" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" "go.opentelemetry.io/otel/trace" ) @@ -39,6 +40,7 @@ var _ http.Handler = &Handler{} // to the span using the attribute.Keys defined in this package. type Handler struct { operation string + server string handler http.Handler tracer trace.Tracer @@ -60,7 +62,8 @@ func defaultHandlerFormatter(operation string, _ *http.Request) string { } // NewHandler wraps the passed handler, functioning like middleware, in a span -// named after the operation and with any provided Options. +// named after the operation and with any provided Options. The server defines +// the name of the (virtual) server handling the request. func NewHandler(handler http.Handler, operation string, opts ...Option) http.Handler { h := Handler{ handler: handler, @@ -90,6 +93,7 @@ func (h *Handler) configure(c *config) { h.spanNameFormatter = c.SpanNameFormatter h.publicEndpoint = c.PublicEndpoint h.publicEndpointFn = c.PublicEndpointFn + h.server = c.ServerName } func handleErr(err error) { @@ -128,7 +132,18 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } ctx := h.propagators.Extract(r.Context(), propagation.HeaderCarrier(r.Header)) - opts := h.spanStartOptions + opts := []trace.SpanStartOption{ + // TODO: pass h.server when + // https://github.com/open-telemetry/opentelemetry-go/pull/3619 is + // resolved, and remove the following if statement. + trace.WithAttributes(httpconv.ServerRequest(r)...), + } + if h.server != "" { + hostAttr := semconv.NetHostNameKey.String(h.server) + opts = append(opts, trace.WithAttributes(hostAttr)) + + } + opts = append(opts, h.spanStartOptions...) if h.publicEndpoint || (h.publicEndpointFn != nil && h.publicEndpointFn(r.WithContext(ctx))) { opts = append(opts, trace.WithNewRoot()) // Linking incoming span context if any for public endpoint. @@ -137,12 +152,6 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } - opts = append([]trace.SpanStartOption{ - trace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", r)...), - trace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(r)...), - trace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(h.operation, "", r)...), - }, opts...) // start with the configured options - tracer := h.tracer if tracer == nil { @@ -212,7 +221,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { setAfterServeAttributes(span, bw.read, rww.written, rww.statusCode, bw.err, rww.err) // Add metrics - attributes := append(labeler.Get(), semconv.HTTPServerMetricAttributesFromHTTPRequest(h.operation, r)...) + attributes := append(labeler.Get(), httpconv.ServerRequest(r)...) h.counters[RequestContentLength].Add(ctx, bw.read, attributes...) h.counters[ResponseContentLength].Add(ctx, rww.written, attributes...) @@ -236,8 +245,10 @@ func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int, if wrote > 0 { attributes = append(attributes, WroteBytesKey.Int64(wrote)) } - attributes = append(attributes, semconv.HTTPAttributesFromHTTPStatusCode(statusCode)...) - span.SetStatus(semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(statusCode, trace.SpanKindServer)) + if statusCode > 0 { + attributes = append(attributes, semconv.HTTPStatusCodeKey.Int(statusCode)) + } + span.SetStatus(httpconv.ServerStatus(statusCode)) if werr != nil && werr != io.EOF { attributes = append(attributes, WriteErrorKey.String(werr.Error())) diff --git a/instrumentation/net/http/otelhttp/test/go.mod b/instrumentation/net/http/otelhttp/test/go.mod index 7b9c77df54d..ede1c0380bc 100644 --- a/instrumentation/net/http/otelhttp/test/go.mod +++ b/instrumentation/net/http/otelhttp/test/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.1 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/sdk/metric v0.34.0 go.opentelemetry.io/otel/trace v1.11.2 diff --git a/instrumentation/net/http/otelhttp/test/go.sum b/instrumentation/net/http/otelhttp/test/go.sum index 82805b86976..6783a3e0a66 100644 --- a/instrumentation/net/http/otelhttp/test/go.sum +++ b/instrumentation/net/http/otelhttp/test/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= diff --git a/instrumentation/net/http/otelhttp/test/handler_test.go b/instrumentation/net/http/otelhttp/test/handler_test.go index 6ad2f3d64b3..2b861c76028 100644 --- a/instrumentation/net/http/otelhttp/test/handler_test.go +++ b/instrumentation/net/http/otelhttp/test/handler_test.go @@ -37,7 +37,7 @@ import ( "go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest" 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.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/instrumentation/net/http/otelhttp/transport.go b/instrumentation/net/http/otelhttp/transport.go index fd5e1e9bc75..03728af191c 100644 --- a/instrumentation/net/http/otelhttp/transport.go +++ b/instrumentation/net/http/otelhttp/transport.go @@ -23,7 +23,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" "go.opentelemetry.io/otel/trace" ) @@ -110,7 +110,7 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { } r = r.WithContext(ctx) - span.SetAttributes(semconv.HTTPClientAttributesFromHTTPRequest(r)...) + span.SetAttributes(httpconv.ClientRequest(r)...) t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header)) res, err := t.rt.RoundTrip(r) @@ -121,8 +121,8 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { return res, err } - span.SetAttributes(semconv.HTTPAttributesFromHTTPStatusCode(res.StatusCode)...) - span.SetStatus(semconv.SpanStatusFromHTTPStatusCode(res.StatusCode)) + span.SetAttributes(httpconv.ClientResponse(*res)...) + span.SetStatus(httpconv.ClientStatus(res.StatusCode)) res.Body = newWrappedBody(span, res.Body) return res, err diff --git a/instrumentation/runtime/example/go.mod b/instrumentation/runtime/example/go.mod index 7ec26aa684a..98fd8532169 100644 --- a/instrumentation/runtime/example/go.mod +++ b/instrumentation/runtime/example/go.mod @@ -6,7 +6,7 @@ replace go.opentelemetry.io/contrib/instrumentation/runtime => ../ require ( go.opentelemetry.io/contrib/instrumentation/runtime v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0 go.opentelemetry.io/otel/metric v0.34.0 go.opentelemetry.io/otel/sdk v1.11.2 diff --git a/instrumentation/runtime/example/go.sum b/instrumentation/runtime/example/go.sum index d7579223c26..29889635d70 100644 --- a/instrumentation/runtime/example/go.sum +++ b/instrumentation/runtime/example/go.sum @@ -7,8 +7,8 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0 h1:O1E9/qhspQSz3O6/dSGLNBND2TO9mUaSvlhcKJMv278= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0/go.mod h1:Id0oYi2ARij/um3gFV+t5rH1MTFdJpfTimsFsqKS7pE= go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= diff --git a/instrumentation/runtime/example/main.go b/instrumentation/runtime/example/main.go index a7fa8446b34..8a50d6ec371 100644 --- a/instrumentation/runtime/example/main.go +++ b/instrumentation/runtime/example/main.go @@ -29,7 +29,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.11.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" ) var res = resource.NewWithAttributes( diff --git a/propagators/opencensus/examples/go.mod b/propagators/opencensus/examples/go.mod index 285f50d498f..7e670e8d065 100644 --- a/propagators/opencensus/examples/go.mod +++ b/propagators/opencensus/examples/go.mod @@ -6,7 +6,7 @@ require ( go.opencensus.io v0.24.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0 go.opentelemetry.io/contrib/propagators/opencensus v0.37.0 - go.opentelemetry.io/otel v1.11.2 + go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 go.opentelemetry.io/otel/sdk v1.11.2 google.golang.org/grpc v1.52.0 diff --git a/propagators/opencensus/examples/go.sum b/propagators/opencensus/examples/go.sum index d6deb5f2311..fb4772fb31d 100644 --- a/propagators/opencensus/examples/go.sum +++ b/propagators/opencensus/examples/go.sum @@ -55,8 +55,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f h1:L7yZgGUs2H/zzXMF6LW7lBUQT5/nevS3ud1oHnzvW8I= +go.opentelemetry.io/otel v1.11.3-0.20230124161041-c7e26795299f/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/bridge/opencensus v0.34.0 h1:yH5TrP1GRsWuZwOPsOguSjOLC2AO9WDhl+jNoaA7WHQ= go.opentelemetry.io/otel/bridge/opencensus v0.34.0/go.mod h1:HnenK8nxUmQSgv3v7jGsr6KHxr3Yg1t/TJB6GzL5bFs= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.2 h1:BhEVgvuE1NWLLuMLvC6sif791F45KFHi5GhOs1KunZU=