From 821a8dbb59a4d3ddd1d7438a7ac112833e17b928 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 2 Jul 2024 22:02:48 +0000 Subject: [PATCH 1/4] Update opentelemetry-go monorepo Signed-off-by: Mend Renovate --- go.mod | 28 ++++++++++++++-------------- go.sum | 56 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/go.mod b/go.mod index 37d41bb7b4c..ce9db2a3510 100644 --- a/go.mod +++ b/go.mod @@ -69,14 +69,14 @@ require ( go.opentelemetry.io/collector/receiver/otlpreceiver v0.104.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 - go.opentelemetry.io/otel v1.27.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0 - go.opentelemetry.io/otel/metric v1.27.0 - go.opentelemetry.io/otel/sdk v1.27.0 - go.opentelemetry.io/otel/trace v1.27.0 + go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 + go.opentelemetry.io/otel/metric v1.28.0 + go.opentelemetry.io/otel/sdk v1.28.0 + go.opentelemetry.io/otel/trace v1.28.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 @@ -102,7 +102,7 @@ require ( github.com/eapache/queue v1.1.0 // indirect github.com/elastic/elastic-transport-go/v8 v8.6.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect @@ -204,18 +204,18 @@ require ( go.opentelemetry.io/otel/bridge/opencensus v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.49.0 + go.opentelemetry.io/otel/exporters/prometheus v0.50.0 go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.27.0 - go.opentelemetry.io/proto/otlp v1.2.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.28.0 + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/text v0.16.0 // indirect gonum.org/v1/gonum v0.15.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/go.sum b/go.sum index d19ce3ecf4e..ae3a62df84b 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -491,36 +491,36 @@ go.opentelemetry.io/contrib/propagators/b3 v1.27.0 h1:IjgxbomVrV9za6bRi8fWCNXENs go.opentelemetry.io/contrib/propagators/b3 v1.27.0/go.mod h1:Dv9obQz25lCisDvvs4dy28UPh974CxkahRDUPsY7y9E= go.opentelemetry.io/contrib/zpages v0.52.0 h1:MPgkMy0Cp3O5EdfVXP0ss3ujhEibysTM4eszx7E7d+E= go.opentelemetry.io/contrib/zpages v0.52.0/go.mod h1:fqG5AFdoYru3A3DnhibVuaaEfQV2WKxE7fYE1jgDRwk= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= go.opentelemetry.io/otel/bridge/opencensus v1.27.0 h1:ao9aGGHd+G4YfjBpGs6vbkvt5hoC67STlJA9fCnOAcs= go.opentelemetry.io/otel/bridge/opencensus v1.27.0/go.mod h1:uRvWtAAXzyVOST0WMPX5JHGBaAvBws+2F8PcC5gMnTk= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 h1:bFgvUr3/O4PHj3VQcFEuYKvRZJX1SJDQ+11JXuSB3/w= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0/go.mod h1:xJntEd2KL6Qdg5lwp97HMLQDVeAhrYxmzFseAMDPQ8I= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 h1:CIHWikMsN3wO+wq1Tp5VGdVRTcON+DmOJSfDjXypKOc= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0/go.mod h1:TNupZ6cxqyFEpLXAZW7On+mLFL0/g0TE3unIYL91xWc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 h1:QY7/0NeRPKlzusf40ZE4t1VlMKbqSNT7cJRYzWuja0s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0/go.mod h1:HVkSiDhTM9BoUJU8qE6j2eSWLLXvi1USXjyd2BXT8PY= -go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= -go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03ymgYhPKmeXGk5Zu+cIZOlVzd9Zv7QIiyItjFBU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk= +go.opentelemetry.io/otel/exporters/prometheus v0.50.0 h1:2Ewsda6hejmbhGFyUvWZjUThC98Cf8Zy6g0zkIimOng= +go.opentelemetry.io/otel/exporters/prometheus v0.50.0/go.mod h1:pMm5PkUo5YwbLiuEf7t2xg4wbP0/eSJrMxIMxKosynY= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 h1:/jlt1Y8gXWiHG9FBx6cJaIC5hYx5Fe64nC8w5Cylt/0= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0/go.mod h1:bmToOGOBZ4hA9ghphIc1PAf66VA8KOtsuy3+ScStG20= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0 h1:/0YaXu3755A/cFbtXp+21lkXgI0QE5avTWA2HjU9/WE= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0/go.mod h1:m7SFxp0/7IxmJPLIY3JhOcU9CoFzDaCPL6xxQIxhA+o= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= -go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= -go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= @@ -657,10 +657,10 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= +google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= From 25fe770d9c679263c646852e906e0eabd2ec5f7b Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 2 Jul 2024 23:29:57 -0400 Subject: [PATCH 2/4] fix Signed-off-by: Yuri Shkuro --- Makefile | 6 ++-- cmd/tracegen/main.go | 6 ++-- examples/hotrod/pkg/tracing/init.go | 6 ++-- .../hotrod/pkg/tracing/rpcmetrics/observer.go | 4 +-- .../pkg/tracing/rpcmetrics/observer_test.go | 8 ++--- examples/hotrod/services/customer/database.go | 4 +-- model/adjuster/otel_tag.go | 10 ++++--- model/adjuster/otel_tag_test.go | 17 +++++++---- pkg/jtracer/jtracer.go | 7 +++-- pkg/otelsemconv/empty_test.go | 25 ++++++++++++++++ pkg/otelsemconv/semconv.go | 29 +++++++++++++++++++ .../metrics/prometheus/metricsstore/reader.go | 6 ++-- plugin/storage/cassandra/spanstore/reader.go | 6 ++-- 13 files changed, 99 insertions(+), 35 deletions(-) create mode 100644 pkg/otelsemconv/empty_test.go create mode 100644 pkg/otelsemconv/semconv.go diff --git a/Makefile b/Makefile index b4d181e2e2c..eaf9228b29b 100644 --- a/Makefile +++ b/Makefile @@ -177,7 +177,7 @@ goleak: @scripts/check-goleak-files.sh $(ALL_PKGS) .PHONY: fmt -fmt: +fmt: $(GOFUMPT) @echo Running import-order-cleanup on ALL_SRC ... @./scripts/import-order-cleanup.py -o inplace -t $(ALL_SRC) @echo Running gofmt on ALL_SRC ... @@ -188,13 +188,13 @@ fmt: @./scripts/updateLicense.py $(ALL_SRC) .PHONY: lint -lint: goleak - $(LINT) -v run +lint: $(LINT) goleak @./scripts/updateLicense.py $(ALL_SRC) > $(FMT_LOG) @./scripts/import-order-cleanup.py -o stdout -t $(ALL_SRC) > $(IMPORT_LOG) @[ ! -s "$(FMT_LOG)" -a ! -s "$(IMPORT_LOG)" ] || (echo "License check or import ordering failures, run 'make fmt'" | cat - $(FMT_LOG) $(IMPORT_LOG) && false) ./scripts/check-semconv-version.sh ./scripts/check-go-version.sh + $(LINT) -v run .PHONY: build-examples build-examples: diff --git a/cmd/tracegen/main.go b/cmd/tracegen/main.go index 7d0c49c2eef..30b70411078 100644 --- a/cmd/tracegen/main.go +++ b/cmd/tracegen/main.go @@ -29,13 +29,13 @@ 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.25.0" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "go.uber.org/zap/zapcore" "github.com/jaegertracing/jaeger/internal/jaegerclientenv2otel" "github.com/jaegertracing/jaeger/internal/tracegen" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" "github.com/jaegertracing/jaeger/pkg/version" ) @@ -84,8 +84,8 @@ func createTracers(cfg *tracegen.Config, logger *zap.Logger) ([]trace.Tracer, fu res, err := resource.New( context.Background(), - resource.WithSchemaURL(semconv.SchemaURL), - resource.WithAttributes(semconv.ServiceNameKey.String(svc)), + resource.WithSchemaURL(otelsemconv.SchemaURL), + resource.WithAttributes(otelsemconv.ServiceNameKey.String(svc)), resource.WithTelemetrySDK(), resource.WithHost(), resource.WithOSType(), diff --git a/examples/hotrod/pkg/tracing/init.go b/examples/hotrod/pkg/tracing/init.go index 994cb22dddb..a4a07ccebdd 100644 --- a/examples/hotrod/pkg/tracing/init.go +++ b/examples/hotrod/pkg/tracing/init.go @@ -31,13 +31,13 @@ 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.25.0" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "github.com/jaegertracing/jaeger/examples/hotrod/pkg/log" "github.com/jaegertracing/jaeger/examples/hotrod/pkg/tracing/rpcmetrics" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" ) var once sync.Once @@ -62,8 +62,8 @@ func InitOTEL(serviceName string, exporterType string, metricsFactory metrics.Fa res, err := resource.New( context.Background(), - resource.WithSchemaURL(semconv.SchemaURL), - resource.WithAttributes(semconv.ServiceNameKey.String(serviceName)), + resource.WithSchemaURL(otelsemconv.SchemaURL), + resource.WithAttributes(otelsemconv.ServiceNameKey.String(serviceName)), resource.WithTelemetrySDK(), resource.WithHost(), resource.WithOSType(), diff --git a/examples/hotrod/pkg/tracing/rpcmetrics/observer.go b/examples/hotrod/pkg/tracing/rpcmetrics/observer.go index 0b3702b53c5..3035993620d 100644 --- a/examples/hotrod/pkg/tracing/rpcmetrics/observer.go +++ b/examples/hotrod/pkg/tracing/rpcmetrics/observer.go @@ -22,10 +22,10 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" sdktrace "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.25.0" "go.opentelemetry.io/otel/trace" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" ) const defaultMaxNumberOfEndpoints = 200 @@ -70,7 +70,7 @@ func (o *Observer) OnEnd(sp sdktrace.ReadOnlySpan) { mets.RequestLatencySuccess.Record(latency) } for _, attr := range sp.Attributes() { - if string(attr.Key) == string(semconv.HTTPResponseStatusCodeKey) { + if string(attr.Key) == string(otelsemconv.HTTPResponseStatusCodeKey) { if attr.Value.Type() == attribute.INT64 { mets.recordHTTPStatusCode(attr.Value.AsInt64()) } else if attr.Value.Type() == attribute.STRING { diff --git a/examples/hotrod/pkg/tracing/rpcmetrics/observer_test.go b/examples/hotrod/pkg/tracing/rpcmetrics/observer_test.go index 27fbb84722e..59af4e665b5 100644 --- a/examples/hotrod/pkg/tracing/rpcmetrics/observer_test.go +++ b/examples/hotrod/pkg/tracing/rpcmetrics/observer_test.go @@ -26,10 +26,10 @@ import ( "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.25.0" "go.opentelemetry.io/otel/trace" u "github.com/jaegertracing/jaeger/internal/metricstest" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" ) type testTracer struct { @@ -45,8 +45,8 @@ func withTestTracer(runTest func(tt *testTracer)) { tp := sdktrace.NewTracerProvider( sdktrace.WithSpanProcessor(observer), sdktrace.WithResource(resource.NewWithAttributes( - semconv.SchemaURL, - semconv.ServiceNameKey.String("test"), + otelsemconv.SchemaURL, + otelsemconv.ServiceNameKey.String("test"), )), ) runTest(&testTracer{ @@ -120,7 +120,7 @@ func TestTags(t *testing.T) { for i := 200; i <= 500; i += 100 { testCases = append(testCases, tagTestCase{ - attr: semconv.HTTPResponseStatusCode(i), + attr: otelsemconv.HTTPResponseStatusCode(i), metrics: []u.ExpectedMetric{ {Name: "http_requests", Value: 1, Tags: tags("status_code", fmt.Sprintf("%dxx", i/100))}, }, diff --git a/examples/hotrod/services/customer/database.go b/examples/hotrod/services/customer/database.go index 67247a11de0..41c6e9a9f48 100644 --- a/examples/hotrod/services/customer/database.go +++ b/examples/hotrod/services/customer/database.go @@ -21,7 +21,6 @@ import ( "fmt" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.25.0" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -29,6 +28,7 @@ import ( "github.com/jaegertracing/jaeger/examples/hotrod/pkg/log" "github.com/jaegertracing/jaeger/examples/hotrod/pkg/tracing" "github.com/jaegertracing/jaeger/examples/hotrod/services/config" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" ) // database simulates Customer repository implemented on top of an SQL database @@ -77,7 +77,7 @@ func (d *database) Get(ctx context.Context, customerID int) (*Customer, error) { ctx, span := d.tracer.Start(ctx, "SQL SELECT", trace.WithSpanKind(trace.SpanKindClient)) span.SetAttributes( - semconv.PeerServiceKey.String("mysql"), + otelsemconv.PeerServiceKey.String("mysql"), attribute. Key("sql.query"). String(fmt.Sprintf("SELECT * FROM customer WHERE customer_id=%d", customerID)), diff --git a/model/adjuster/otel_tag.go b/model/adjuster/otel_tag.go index 6e32a12ce81..18b5714bdd9 100644 --- a/model/adjuster/otel_tag.go +++ b/model/adjuster/otel_tag.go @@ -15,14 +15,16 @@ package adjuster import ( - semconv "go.opentelemetry.io/otel/semconv/v1.25.0" - "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" ) var otelLibraryKeys = map[string]struct{}{ - string(semconv.OTelLibraryNameKey): {}, - string(semconv.OTelLibraryVersionKey): {}, + string(otelsemconv.TelemetrySDKLanguageKey): {}, + string(otelsemconv.TelemetrySDKNameKey): {}, + string(otelsemconv.TelemetrySDKVersionKey): {}, + string(otelsemconv.TelemetryDistroNameKey): {}, + string(otelsemconv.TelemetryDistroVersionKey): {}, } func OTelTagAdjuster() Adjuster { diff --git a/model/adjuster/otel_tag_test.go b/model/adjuster/otel_tag_test.go index 95bd37333ca..02e50104640 100644 --- a/model/adjuster/otel_tag_test.go +++ b/model/adjuster/otel_tag_test.go @@ -19,9 +19,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - semconv "go.opentelemetry.io/otel/semconv/v1.25.0" "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" ) func TestOTelTagAdjuster(t *testing.T) { @@ -35,8 +35,12 @@ func TestOTelTagAdjuster(t *testing.T) { span: &model.Span{ Tags: model.KeyValues{ model.String("random_key", "random_value"), - model.String(string(semconv.OTelLibraryNameKey), "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"), - model.String(string(semconv.OTelLibraryVersionKey), "0.45.0"), + model.String(string(otelsemconv.TelemetrySDKLanguageKey), "Go"), + model.String(string(otelsemconv.TelemetrySDKNameKey), "opentelemetry"), + model.String(string(otelsemconv.TelemetrySDKVersionKey), "1.27.0"), + // distro attrs intentionally after SDK attrs to test sorting + model.String(string(otelsemconv.TelemetryDistroNameKey), "opentelemetry"), + model.String(string(otelsemconv.TelemetryDistroVersionKey), "blah"), model.String("another_key", "another_value"), }, Process: &model.Process{ @@ -50,8 +54,11 @@ func TestOTelTagAdjuster(t *testing.T) { }, Process: &model.Process{ Tags: model.KeyValues{ - model.String(string(semconv.OTelLibraryNameKey), "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"), - model.String(string(semconv.OTelLibraryVersionKey), "0.45.0"), + model.String(string(otelsemconv.TelemetryDistroNameKey), "opentelemetry"), + model.String(string(otelsemconv.TelemetryDistroVersionKey), "blah"), + model.String(string(otelsemconv.TelemetrySDKLanguageKey), "Go"), + model.String(string(otelsemconv.TelemetrySDKNameKey), "opentelemetry"), + model.String(string(otelsemconv.TelemetrySDKVersionKey), "1.27.0"), }, }, }, diff --git a/pkg/jtracer/jtracer.go b/pkg/jtracer/jtracer.go index f8329ba0e29..21e637d042d 100644 --- a/pkg/jtracer/jtracer.go +++ b/pkg/jtracer/jtracer.go @@ -24,9 +24,10 @@ 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.25.0" "go.opentelemetry.io/otel/trace" nooptrace "go.opentelemetry.io/otel/trace/noop" + + "github.com/jaegertracing/jaeger/pkg/otelsemconv" ) type JTracer struct { @@ -110,8 +111,8 @@ func initHelper( func otelResource(ctx context.Context, svc string) (*resource.Resource, error) { return resource.New( ctx, - resource.WithSchemaURL(semconv.SchemaURL), - resource.WithAttributes(semconv.ServiceNameKey.String(svc)), + resource.WithSchemaURL(otelsemconv.SchemaURL), + resource.WithAttributes(otelsemconv.ServiceNameKey.String(svc)), resource.WithTelemetrySDK(), resource.WithHost(), resource.WithOSType(), diff --git a/pkg/otelsemconv/empty_test.go b/pkg/otelsemconv/empty_test.go new file mode 100644 index 00000000000..23a90d54a49 --- /dev/null +++ b/pkg/otelsemconv/empty_test.go @@ -0,0 +1,25 @@ +// Copyright (c) 2023 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otelsemconv + +import ( + "testing" + + "github.com/jaegertracing/jaeger/pkg/testutils" +) + +func TestMain(m *testing.M) { + testutils.VerifyGoLeaks(m) +} diff --git a/pkg/otelsemconv/semconv.go b/pkg/otelsemconv/semconv.go new file mode 100644 index 00000000000..9acb3b88e2c --- /dev/null +++ b/pkg/otelsemconv/semconv.go @@ -0,0 +1,29 @@ +// Copyright (c) 2024 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + +package otelsemconv + +import ( + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" +) + +// We do not use a lot of semconv constants, and its annoying to keep +// the semver of the imports the same. This package serves as a +// one stop shop replacement / alias. +const ( + SchemaURL = semconv.SchemaURL + + TelemetrySDKLanguageKey = semconv.TelemetrySDKLanguageKey + TelemetrySDKNameKey = semconv.TelemetrySDKNameKey + TelemetrySDKVersionKey = semconv.TelemetrySDKVersionKey + TelemetryDistroNameKey = semconv.TelemetryDistroNameKey + TelemetryDistroVersionKey = semconv.TelemetryDistroVersionKey + + ServiceNameKey = semconv.ServiceNameKey + DBQueryTextKey = semconv.DBQueryTextKey + DBSystemKey = semconv.DBSystemKey + PeerServiceKey = semconv.PeerServiceKey + HTTPResponseStatusCodeKey = semconv.HTTPResponseStatusCodeKey +) + +var HTTPResponseStatusCode = semconv.HTTPResponseStatusCode diff --git a/plugin/metrics/prometheus/metricsstore/reader.go b/plugin/metrics/prometheus/metricsstore/reader.go index e65c97edbdc..c91b68fec57 100644 --- a/plugin/metrics/prometheus/metricsstore/reader.go +++ b/plugin/metrics/prometheus/metricsstore/reader.go @@ -30,11 +30,11 @@ import ( promapi "github.com/prometheus/client_golang/api/prometheus/v1" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.25.0" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "github.com/jaegertracing/jaeger/pkg/bearertoken" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" "github.com/jaegertracing/jaeger/pkg/prometheus/config" "github.com/jaegertracing/jaeger/plugin/metrics/prometheus/metricsstore/dbmodel" "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" @@ -314,8 +314,8 @@ func promqlDurationString(d *time.Duration) string { func startSpanForQuery(ctx context.Context, metricName, query string, tp trace.Tracer) (context.Context, trace.Span) { ctx, span := tp.Start(ctx, metricName) span.SetAttributes( - attribute.Key(semconv.DBStatementKey).String(query), - attribute.Key(semconv.DBSystemKey).String("prometheus"), + attribute.Key(otelsemconv.DBQueryTextKey).String(query), + attribute.Key(otelsemconv.DBSystemKey).String("prometheus"), attribute.Key("component").String("promql"), ) return ctx, span diff --git a/plugin/storage/cassandra/spanstore/reader.go b/plugin/storage/cassandra/spanstore/reader.go index 7ef2f23250f..66e279dff2a 100644 --- a/plugin/storage/cassandra/spanstore/reader.go +++ b/plugin/storage/cassandra/spanstore/reader.go @@ -23,7 +23,6 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.25.0" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -31,6 +30,7 @@ import ( "github.com/jaegertracing/jaeger/pkg/cassandra" casMetrics "github.com/jaegertracing/jaeger/pkg/cassandra/metrics" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/otelsemconv" "github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore/dbmodel" "github.com/jaegertracing/jaeger/storage/spanstore" ) @@ -430,8 +430,8 @@ func (s *SpanReader) executeQuery(span trace.Span, query cassandra.Query, tableM func (s *SpanReader) startSpanForQuery(ctx context.Context, name, query string) (context.Context, trace.Span) { ctx, span := s.tracer.Start(ctx, name) span.SetAttributes( - attribute.Key(semconv.DBStatementKey).String(query), - attribute.Key(semconv.DBSystemKey).String("cassandra"), + attribute.Key(otelsemconv.DBQueryTextKey).String(query), + attribute.Key(otelsemconv.DBSystemKey).String("cassandra"), attribute.Key("component").String("gocql"), ) return ctx, span From df70e8f5ada5cf1886bcb39fc57f06c27d33c83e Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 2 Jul 2024 23:36:06 -0400 Subject: [PATCH 3/4] fix Signed-off-by: Yuri Shkuro --- go.mod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ce9db2a3510..d10e3441a59 100644 --- a/go.mod +++ b/go.mod @@ -40,6 +40,7 @@ require ( github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/xdg-go/scram v1.1.2 go.opentelemetry.io/collector/component v0.104.0 + go.opentelemetry.io/collector/config/configauth v0.104.0 go.opentelemetry.io/collector/config/configgrpc v0.104.0 go.opentelemetry.io/collector/config/confighttp v0.104.0 go.opentelemetry.io/collector/config/configretry v1.11.0 @@ -73,9 +74,11 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 + go.opentelemetry.io/otel/exporters/prometheus v0.50.0 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 go.opentelemetry.io/otel/metric v1.28.0 go.opentelemetry.io/otel/sdk v1.28.0 + go.opentelemetry.io/otel/sdk/metric v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/goleak v1.3.0 @@ -187,7 +190,6 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.104.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.104.0 go.opentelemetry.io/collector/config/configcompression v1.11.0 // indirect go.opentelemetry.io/collector/config/confignet v0.104.0 // indirect go.opentelemetry.io/collector/config/configopaque v1.11.0 // indirect @@ -204,9 +206,7 @@ require ( go.opentelemetry.io/otel/bridge/opencensus v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.50.0 go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.28.0 go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect From d46cf6ed116bbfbf3aea8d8574bdb357d7ebcf7c Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 2 Jul 2024 23:42:11 -0400 Subject: [PATCH 4/4] fix Signed-off-by: Yuri Shkuro --- pkg/otelsemconv/empty_test.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pkg/otelsemconv/empty_test.go b/pkg/otelsemconv/empty_test.go index 23a90d54a49..c172ec0a46d 100644 --- a/pkg/otelsemconv/empty_test.go +++ b/pkg/otelsemconv/empty_test.go @@ -1,16 +1,5 @@ -// Copyright (c) 2023 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) 2024 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 package otelsemconv