diff --git a/CHANGELOG.md b/CHANGELOG.md index a34eaf45919..148f8cfdd3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,11 +14,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - `otelmux`: Add new `WithSpanNameFormatter` option to `go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux` to allow customizing span names. (#3041) - Add missing recommended AWS Lambda resource attributes `faas.instance` and `faas.max_memory` in `go.opentelemetry.io/contrib/detectors/aws/lambda`. (#3148) - Improve documentation for `samplers/jaegerremote` by providing examples of sampling endpoints. (#3147) +- Add `WithServerName` to `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` to set the primary server name of a `Handler`. (#3182) ### Changed - Updated to the new metric API. (#3170) - `otelgrpc`: Remove expensive calculation of uncompressed message size attribute. (#3168) +- Upgrade all `semconv` packages to use `v1.17.0`. (#3182) ## [1.12.0/0.37.0/0.6.0] 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..e944e228480 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.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/detectors/aws/ec2/go.sum b/detectors/aws/ec2/go.sum index 6b93d430feb..552aec69168 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..fca4464461f 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.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/detectors/aws/ecs/go.sum b/detectors/aws/ecs/go.sum index fdc3e892322..85d4275ece0 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..7ea19e35790 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.20230126195513-af3db6e8bed6 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..1df79916e4e 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..b77e2e1f949 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.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/detectors/aws/lambda/go.sum b/detectors/aws/lambda/go.sum index 90b60c12543..eebdf19985f 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..538eb23c722 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.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/sdk v1.11.2 ) diff --git a/detectors/gcp/go.sum b/detectors/gcp/go.sum index 1e1c6e93304..d19174fe47a 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..4438fe840f6 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.20230126195513-af3db6e8bed6 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..a73fa2bb288 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..56de16395a7 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.20230126195513-af3db6e8bed6 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..3faeaaa2059 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..eb7b86dbf66 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.20230126195513-af3db6e8bed6 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..36cbc092693 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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 c2e6091df52..82e69cfcaba 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.20230126195513-af3db6e8bed6 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 f15ee5cb4fe..137de00e049 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= 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 cf5d4dcbfee..707529f0048 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.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 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 10e6b7c0c39..b5714128fab 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5/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 2cdbd2e22e2..9d2350b7714 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.20230126195513-af3db6e8bed6 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 7ad5548505b..ce78ab39bdb 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5/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 e9779d1b9a7..57b51a4860c 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.20230126195513-af3db6e8bed6 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 1fca97e587a..d4652696372 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= 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..c01c8ff8bbb 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.20230126195513-af3db6e8bed6 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..5fcae76d39c 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..4cc7fd70c36 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.20230126195513-af3db6e8bed6 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..abc57439844 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..3e4a222d12d 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.20230126195513-af3db6e8bed6 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..453f02f2b5b 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..af9967983c0 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.20230126195513-af3db6e8bed6 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..b8c145fb8ad 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..6faf78d89a3 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.20230126195513-af3db6e8bed6 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..1214ca49dc9 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..0ae459f5e86 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.20230126195513-af3db6e8bed6 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..08e58e29d04 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..1a5d02eb1c0 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.20230126195513-af3db6e8bed6 // 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..5d44c0129d2 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..392cc224b9d 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.20230126195513-af3db6e8bed6 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..95b4428668e 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..1e0ac1dbf4f 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.20230126195513-af3db6e8bed6 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..b5949feb382 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..249755c3afd 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.20230126195513-af3db6e8bed6 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..e2adeebe7b0 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..52119e7db8a 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.20230126195513-af3db6e8bed6 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..c787e058dfa 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..5bc3941664a 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" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -51,12 +52,16 @@ 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(service, r)...), 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 +69,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..a2c9ef43647 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.20230126195513-af3db6e8bed6 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..ee324061494 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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/test/restful_test.go b/instrumentation/github.com/emicklei/go-restful/otelrestful/test/restful_test.go index dbc01ba6ba5..9b1c162be51 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/test/restful_test.go +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/test/restful_test.go @@ -104,7 +104,7 @@ func TestChildSpanNames(t *testing.T) { t, spans[0], "/user/{id:[0-9]+}", - 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"), @@ -120,7 +120,7 @@ func TestChildSpanNames(t *testing.T) { t, spans[1], "/book/{title}", - 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"), 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..3118c598522 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.20230126195513-af3db6e8bed6 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..4b8e3a89783 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..0a0617df2ca 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" + 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,14 +70,15 @@ 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(service, c.Request)...), 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 +90,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..3b9ae1cc663 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.20230126195513-af3db6e8bed6 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..7a6877d741b 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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/gintrace_test.go b/instrumentation/github.com/gin-gonic/gin/otelgin/test/gintrace_test.go index b430c5c8cf7..a156ac6adda 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/test/gintrace_test.go +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/test/gintrace_test.go @@ -98,7 +98,7 @@ func TestTrace200(t *testing.T) { assert.Equal(t, "/user/:id", span.Name()) assert.Equal(t, oteltrace.SpanKindServer, span.SpanKind()) attr := span.Attributes() - assert.Contains(t, attr, attribute.String("http.server_name", "foobar")) + assert.Contains(t, attr, attribute.String("net.host.name", "foobar")) assert.Contains(t, attr, attribute.Int("http.status_code", http.StatusOK)) assert.Contains(t, attr, attribute.String("http.method", "GET")) assert.Contains(t, attr, attribute.String("http.target", "/user/123")) @@ -130,7 +130,7 @@ func TestError(t *testing.T) { span := spans[0] assert.Equal(t, "/server_err", span.Name()) attr := span.Attributes() - assert.Contains(t, attr, attribute.String("http.server_name", "foobar")) + assert.Contains(t, attr, attribute.String("net.host.name", "foobar")) assert.Contains(t, attr, attribute.Int("http.status_code", http.StatusInternalServerError)) assert.Contains(t, attr, attribute.String("gin.errors", "Error #01: oh no\n")) // server errors set the status 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..6b8fa0c1894 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.20230126195513-af3db6e8bed6 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..035a18011a1 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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 73baa893514..6968d291a43 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.3-0.20230119184437-b1a8002c4cf5 + go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 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.1-0.20230119184437-b1a8002c4cf5 diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum index ee9ce0514a0..76dcab224a0 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.3-0.20230119184437-b1a8002c4cf5 h1:noFrde4cmjaYGfLO6FitAi79aeq/AAiS6lLdrss4MRA= -go.opentelemetry.io/otel v1.11.3-0.20230119184437-b1a8002c4cf5/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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 4fdf5812dec..a677007b4d8 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.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 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 78b1f2fdbcb..11feb5643ac 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5/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 3915753a0fb..77eb136b212 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.3-0.20230119184437-b1a8002c4cf5 + go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/sdk/metric v0.34.1-0.20230119184437-b1a8002c4cf5 diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/test/go.sum b/instrumentation/github.com/gocql/gocql/otelgocql/test/go.sum index a61374fbad4..8aab2ac41ec 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.3-0.20230119184437-b1a8002c4cf5 h1:noFrde4cmjaYGfLO6FitAi79aeq/AAiS6lLdrss4MRA= -go.opentelemetry.io/otel v1.11.3-0.20230119184437-b1a8002c4cf5/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5/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..6c3042fe208 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.20230126195513-af3db6e8bed6 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..7222aa9238d 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..9522e1ccead 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.20230126195513-af3db6e8bed6 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..65f6362ea4c 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..e5e0961c0c6 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" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -135,15 +136,16 @@ 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(tw.service, r)...), 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 +153,8 @@ 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)) } diff --git a/instrumentation/github.com/gorilla/mux/otelmux/test/go.mod b/instrumentation/github.com/gorilla/mux/otelmux/test/go.mod index 6462c4e8127..93baa359662 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.20230126195513-af3db6e8bed6 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..65f6362ea4c 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..f6d823673ec 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,13 @@ 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(service, request)...), 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 +96,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..bc2e91c76d9 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.20230126195513-af3db6e8bed6 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..79908661327 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..ff571380c64 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.20230126195513-af3db6e8bed6 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..5f23f1abc19 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..41b3e7dabda 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.20230126195513-af3db6e8bed6 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..06feb72dbf9 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..d0296710c2d 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.20230126195513-af3db6e8bed6 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..8ca6a0133f7 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..f0ccd34239d 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.20230126195513-af3db6e8bed6 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..39c3f9c81c3 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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 dcebcb34ab1..f491fe56462 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/config.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/config.go @@ -22,7 +22,7 @@ import ( "go.opentelemetry.io/otel/metric/instrument" "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 f1be72dd204..827bfefa75f 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.20230126195513-af3db6e8bed6 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 80f99c0ce66..0ef26971e48 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/go.mod b/instrumentation/google.golang.org/grpc/otelgrpc/go.mod index 8a8545cef7f..aa97f1e9440 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.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 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 2202ab446fd..195f4726288 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5/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 08b18ed51f1..d22bcf2e450 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.3-0.20230119184437-b1a8002c4cf5 + go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/sdk/metric v0.34.1-0.20230119184437-b1a8002c4cf5 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 0dee4a6fb25..9fc30885b2e 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.3-0.20230119184437-b1a8002c4cf5 h1:noFrde4cmjaYGfLO6FitAi79aeq/AAiS6lLdrss4MRA= -go.opentelemetry.io/otel v1.11.3-0.20230119184437-b1a8002c4cf5/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5/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..2c89dfdd020 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go @@ -18,6 +18,7 @@ import ( "context" "errors" "io" + "net" "strings" "testing" "time" @@ -28,7 +29,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" @@ -39,6 +40,7 @@ import ( "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/grpc/test/bufconn" ) func getSpanFromRecorder(sr *tracetest.SpanRecorder, name string) (trace.ReadOnlySpan, bool) { @@ -65,8 +67,21 @@ func (mcuici *mockUICInvoker) invoker(ctx context.Context, method string, req, r return nil } +func ctxDialer() func(context.Context, string) (net.Conn, error) { + l := bufconn.Listen(0) + return func(ctx context.Context, _ string) (net.Conn, error) { + return l.DialContext(ctx) + } +} + func TestUnaryClientInterceptor(t *testing.T) { - clientConn, err := grpc.Dial("fake:connection", grpc.WithTransportCredentials(insecure.NewCredentials())) + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + + clientConn, err := grpc.DialContext(ctx, "fake:8906", + grpc.WithContextDialer(ctxDialer()), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) if err != nil { t.Fatalf("failed to create client connection: %v", err) } @@ -96,8 +111,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 +133,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 +155,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 +178,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 +199,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 +221,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{ { @@ -283,8 +298,14 @@ func newMockClientStream(opts clientStreamOpts) *mockClientStream { } func createInterceptedStreamClient(t *testing.T, method string, opts clientStreamOpts) (grpc.ClientStream, *tracetest.SpanRecorder) { + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + mockStream := newMockClientStream(opts) - clientConn, err := grpc.Dial("fake:connection", grpc.WithTransportCredentials(insecure.NewCredentials())) + clientConn, err := grpc.DialContext(ctx, "fake:8906", + grpc.WithContextDialer(ctxDialer()), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) if err != nil { t.Fatalf("failed to create client connection: %v", err) } @@ -352,8 +373,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 +441,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 +470,14 @@ 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())) + + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + + clientConn, err := grpc.DialContext(ctx, "fake:8906", + grpc.WithContextDialer(ctxDialer()), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) if err != nil { t.Fatalf("failed to create client connection: %v", err) } @@ -502,7 +530,13 @@ func TestStreamClientInterceptorCancelContext(t *testing.T) { func TestStreamClientInterceptorWithError(t *testing.T) { defer goleak.VerifyNone(t) - clientConn, err := grpc.Dial("fake:connection", grpc.WithTransportCredentials(insecure.NewCredentials())) + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + + clientConn, err := grpc.DialContext(ctx, "fake:8906", + grpc.WithContextDialer(ctxDialer()), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) if err != nil { t.Fatalf("failed to create client connection: %v", err) } @@ -542,8 +576,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..25cc23195e6 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.20230126195513-af3db6e8bed6 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..6c3e0595ba2 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..db392162ac0 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.20230126195513-af3db6e8bed6 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..3fc12aa7ec8 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..627b3b2fea6 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" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" oteltrace "go.opentelemetry.io/otel/trace" ) @@ -43,9 +44,7 @@ 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(service, c.Req.Request)...), oteltrace.WithSpanKind(oteltrace.SpanKindServer), } // TODO: span name should be router template not the actual request path, eg /user/:id vs /user/123 @@ -63,9 +62,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..aeaa262fcbd 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.20230126195513-af3db6e8bed6 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..b8fcb06d44a 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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 6415506ab16..df303d20872 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.3-0.20230119184437-b1a8002c4cf5 + go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 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.1-0.20230119184437-b1a8002c4cf5 diff --git a/instrumentation/host/example/go.sum b/instrumentation/host/example/go.sum index afbe9fd965b..c7f9befccc2 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.3-0.20230119184437-b1a8002c4cf5 h1:noFrde4cmjaYGfLO6FitAi79aeq/AAiS6lLdrss4MRA= -go.opentelemetry.io/otel v1.11.3-0.20230119184437-b1a8002c4cf5/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= 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..9c2d9622c8f 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) { @@ -342,7 +342,7 @@ func (ct *clientTracer) wroteHeaderField(k string, v []string) { if _, ok := ct.redactedHeaders[k]; ok { value = "****" } - ct.root.SetAttributes(attribute.String("http."+k, value)) + ct.root.SetAttributes(attribute.String("http.request.header."+k, value)) } func (ct *clientTracer) wroteHeaders() { 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 52c3040997d..af2ae7cc8e0 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.20230126195513-af3db6e8bed6 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 04b6094e243..9d0218bc585 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= 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..2ab5219b807 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.20230126195513-af3db6e8bed6 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..2adc143c875 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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..156a6e4ee5f 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.17.0" + "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" + "go.opentelemetry.io/otel/semconv/v1.17.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/clienttrace_test.go b/instrumentation/net/http/httptrace/otelhttptrace/test/clienttrace_test.go index 8b1758de9cf..a69ec1d999b 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/test/clienttrace_test.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/test/clienttrace_test.go @@ -102,7 +102,7 @@ func TestHTTPRequestWithClientTrace(t *testing.T) { name: "http.getconn", attributes: []attribute.KeyValue{ attribute.Key("http.remote").String(address.String()), - attribute.Key("http.host").String(address.String()), + attribute.Key("net.host.name").String(address.String()), attribute.Key("http.conn.reused").Bool(false), attribute.Key("http.conn.wasidle").Bool(false), }, @@ -325,10 +325,10 @@ func TestWithoutSubSpans(t *testing.T) { require.Len(t, gotAttributes, 4) assert.Equal(t, []attribute.KeyValue{ - attribute.Key("http.host").String(fixture.Address), - attribute.Key("http.user-agent").String("oteltest/1.1"), - attribute.Key("http.authorization").String("****"), - attribute.Key("http.accept-encoding").String("gzip"), + attribute.Key("http.request.header.host").String(fixture.Address), + attribute.Key("http.request.header.user-agent").String("oteltest/1.1"), + attribute.Key("http.request.header.authorization").String("****"), + attribute.Key("http.request.header.accept-encoding").String("gzip"), }, gotAttributes, ) @@ -341,7 +341,7 @@ func TestWithoutSubSpans(t *testing.T) { {"http.getconn.start", func(t *testing.T, got attrMap) { assert.Equal(t, attribute.StringValue(fixture.Address), - got[attribute.Key("http.host")], + got[attribute.Key("net.host.name")], ) }}, {"http.getconn.done", func(t *testing.T, got attrMap) { @@ -408,9 +408,9 @@ func TestWithRedactedHeaders(t *testing.T) { gotAttributes := recSpan.Attributes() assert.Equal(t, []attribute.KeyValue{ - attribute.Key("http.host").String(fixture.Address), - attribute.Key("http.user-agent").String("****"), - attribute.Key("http.accept-encoding").String("gzip"), + attribute.Key("http.request.header.host").String(fixture.Address), + attribute.Key("http.request.header.user-agent").String("****"), + attribute.Key("http.request.header.accept-encoding").String("gzip"), }, gotAttributes, ) @@ -463,10 +463,10 @@ func TestWithInsecureHeaders(t *testing.T) { gotAttributes := recSpan.Attributes() assert.Equal(t, []attribute.KeyValue{ - attribute.Key("http.host").String(fixture.Address), - attribute.Key("http.user-agent").String("oteltest/1.1"), - attribute.Key("http.authorization").String("Bearer token123"), - attribute.Key("http.accept-encoding").String("gzip"), + attribute.Key("http.request.header.host").String(fixture.Address), + attribute.Key("http.request.header.user-agent").String("oteltest/1.1"), + attribute.Key("http.request.header.authorization").String("Bearer token123"), + attribute.Key("http.request.header.accept-encoding").String("gzip"), }, gotAttributes, ) diff --git a/instrumentation/net/http/httptrace/otelhttptrace/test/go.mod b/instrumentation/net/http/httptrace/otelhttptrace/test/go.mod index b4472134f36..806ca20e9e6 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.20230126195513-af3db6e8bed6 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..eebdf19985f 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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 2cfc93bb2cc..be4b8a9ca6f 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.3-0.20230119184437-b1a8002c4cf5 + go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 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.1-0.20230119184437-b1a8002c4cf5 diff --git a/instrumentation/net/http/otelhttp/example/go.sum b/instrumentation/net/http/otelhttp/example/go.sum index 0cbdd18bffc..adde9ecd7de 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.3-0.20230119184437-b1a8002c4cf5 h1:noFrde4cmjaYGfLO6FitAi79aeq/AAiS6lLdrss4MRA= -go.opentelemetry.io/otel v1.11.3-0.20230119184437-b1a8002c4cf5/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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 e60da9aea20..fde605ee62b 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.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 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 9bcecc3947b..e5f95762fe5 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.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5/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 a52be4e9bb8..60945801bac 100644 --- a/instrumentation/net/http/otelhttp/handler.go +++ b/instrumentation/net/http/otelhttp/handler.go @@ -26,7 +26,8 @@ import ( "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/instrument" "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" ) @@ -38,6 +39,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 @@ -89,6 +91,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) { @@ -127,7 +130,14 @@ 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{ + trace.WithAttributes(httpconv.ServerRequest(h.server, 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. @@ -136,12 +146,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 { @@ -211,7 +215,10 @@ 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(h.server, r)...) + if rww.statusCode > 0 { + attributes = append(attributes, semconv.HTTPStatusCodeKey.Int(rww.statusCode)) + } h.counters[RequestContentLength].Add(ctx, bw.read, attributes...) h.counters[ResponseContentLength].Add(ctx, rww.written, attributes...) @@ -235,8 +242,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 01fea35a6cd..e934cbc2d30 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.3-0.20230119184437-b1a8002c4cf5 + go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/sdk/metric v0.34.1-0.20230119184437-b1a8002c4cf5 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 83ac237975e..ad588fca743 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.3-0.20230119184437-b1a8002c4cf5 h1:noFrde4cmjaYGfLO6FitAi79aeq/AAiS6lLdrss4MRA= -go.opentelemetry.io/otel v1.11.3-0.20230119184437-b1a8002c4cf5/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5/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..034f8e18ff2 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" ) @@ -91,8 +91,6 @@ func TestHandlerBasics(t *testing.T) { reader := metric.NewManualReader() meterProvider := metric.NewMeterProvider(metric.WithReader(reader)) - operation := "test_handler" - h := otelhttp.NewHandler( http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { l, _ := otelhttp.LabelerFromContext(r.Context()) @@ -101,7 +99,7 @@ func TestHandlerBasics(t *testing.T) { if _, err := io.WriteString(w, "hello world"); err != nil { t.Fatal(err) } - }), operation, + }), "test_handler", otelhttp.WithTracerProvider(provider), otelhttp.WithMeterProvider(meterProvider), otelhttp.WithPropagators(propagation.TraceContext{}), @@ -117,12 +115,13 @@ func TestHandlerBasics(t *testing.T) { require.NoError(t, err) require.Len(t, rm.ScopeMetrics, 1) attrs := attribute.NewSet( - semconv.HTTPServerNameKey.String(operation), + semconv.NetHostNameKey.String(r.Host), semconv.HTTPSchemeHTTP, - semconv.HTTPHostKey.String(r.Host), + semconv.HTTPTargetKey.String(r.URL.Path), semconv.HTTPFlavorKey.String(fmt.Sprintf("1.%d", r.ProtoMinor)), semconv.HTTPMethodKey.String("GET"), attribute.String("test", "attribute"), + semconv.HTTPStatusCodeKey.Int(200), ) assertScopeMetrics(t, rm.ScopeMetrics[0], attrs) diff --git a/instrumentation/net/http/otelhttp/transport.go b/instrumentation/net/http/otelhttp/transport.go index fd5e1e9bc75..9dda7e1a957 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 e6f31252f0d..67e8aecfc02 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.3-0.20230119184437-b1a8002c4cf5 + go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.34.0 go.opentelemetry.io/otel/metric v0.34.1-0.20230119184437-b1a8002c4cf5 go.opentelemetry.io/otel/sdk v1.11.2 diff --git a/instrumentation/runtime/example/go.sum b/instrumentation/runtime/example/go.sum index a928e955c8d..8ab99f716f5 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.3-0.20230119184437-b1a8002c4cf5 h1:noFrde4cmjaYGfLO6FitAi79aeq/AAiS6lLdrss4MRA= -go.opentelemetry.io/otel v1.11.3-0.20230119184437-b1a8002c4cf5/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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.1-0.20230119184437-b1a8002c4cf5 h1:C0lkl0F56ubmE90lqBz5xvu+WcH3t/jn8YNqlOeNkZA= 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 fafcb4c3536..1d88dcc7af6 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.3-0.20230119184437-b1a8002c4cf5 + go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 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 134d2f44a7d..f62911b12a8 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.3-0.20230119184437-b1a8002c4cf5 h1:noFrde4cmjaYGfLO6FitAi79aeq/AAiS6lLdrss4MRA= -go.opentelemetry.io/otel v1.11.3-0.20230119184437-b1a8002c4cf5/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6 h1:BBMki5cl4HIYsswWSZ/WBnD1pkpQzZ7VyAK46S7QeNE= +go.opentelemetry.io/otel v1.11.3-0.20230126195513-af3db6e8bed6/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=